Skip to content

Add Container Apps environment conflict pre-deployment check to azure-deploy#1746

Open
Copilot wants to merge 9 commits intomainfrom
copilot/fix-azure-deploy-timeout-again
Open

Add Container Apps environment conflict pre-deployment check to azure-deploy#1746
Copilot wants to merge 9 commits intomainfrom
copilot/fix-azure-deploy-timeout-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

azd up silently resolves existing Container Apps environment conflicts by creating a new environment (e.g. "deployment-prod"), causing unexpectedly long deployments and test timeouts.

Changes

  • pre-deploy-checklist.md — New mandatory Step 5a for Container Apps deployments: run az containerapp env list against the target resource group before azd up. If existing environments are found, surface them via ask_user with three resolution paths:
    1. Select the matching AZD env to reuse the existing environment (recommended)
    2. Create a new env with a unique name targeting a clean resource group
    3. Delete the conflicting environment (destructive; requires user confirmation per global-rules)
  • pre-deploy-checklist.md — Added Skipping Container Apps environment check to the Common Mistakes table
  • SKILL.md — Version bumped 1.0.15 → 1.0.17

Example check

az containerapp env list \
  --resource-group rg-<env-name> \
  --query "[].{name:name, location:location, provisioningState:properties.provisioningState}" \
  -o table

Copilot AI changed the title [WIP] Fix integration test failure for azure deployment of nodejs-demoapp Add Container Apps environment conflict pre-deployment check to azure-deploy Apr 7, 2026
Copilot AI requested a review from fanyang-mono April 7, 2026 16:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Details# 🔍 Token Analysis Report

@github-copilot-for-azure/scripts@1.0.0 tokens
node --import tsx src/tokens/cli.ts compare --base origin/main --head HEAD --markdown

📊 Token Change Report

Comparing origin/mainHEAD

Summary

Metric Value
📈 Total Change +677 tokens (+18%)
Before 3,847 tokens
After 4,524 tokens
Files Changed 1

Changed Files

File Before After Change
plugin/skills/azure-deploy/references/pre-deploy-checklist.md 2,204 2,881 +677 (+31%)

@github-copilot-for-azure/scripts@1.0.0 tokens
node --import tsx src/tokens/cli.ts check --markdown

📊 Token Limit Check Report

Checked: 543 files
Exceeded: 74 files

⚠️ Files Exceeding Token Limits

File Tokens Limit Over By
.github/skills/analyze-test-run/SKILL.md 2471 500 +1971
.github/skills/file-test-bug/SKILL.md 628 500 +128
.github/skills/sensei/README.md 3531 2000 +1531
.github/skills/sensei/SKILL.md 3026 500 +2526
.github/skills/sensei/references/EXAMPLES.md 3701 2000 +1701
.github/skills/sensei/references/LOOP.md 4181 2000 +2181
.github/skills/sensei/references/SCORING.md 4200 2000 +2200
.github/skills/skill-authoring/SKILL.md 839 500 +339
plugin/skills/appinsights-instrumentation/SKILL.md 908 500 +408
plugin/skills/azure-ai/SKILL.md 817 500 +317
plugin/skills/azure-aigateway/SKILL.md 1258 500 +758
plugin/skills/azure-aigateway/references/policies.md 2342 2000 +342
plugin/skills/azure-cloud-migrate/references/services/functions/lambda-to-functions.md 2600 2000 +600
plugin/skills/azure-cloud-migrate/references/services/functions/runtimes/javascript.md 2181 2000 +181
plugin/skills/azure-compliance/SKILL.md 1185 500 +685
plugin/skills/azure-compute/SKILL.md 755 500 +255
plugin/skills/azure-compute/workflows/vm-recommender/vm-recommender.md 2393 2000 +393
plugin/skills/azure-cost/SKILL.md 1861 500 +1361
plugin/skills/azure-deploy/SKILL.md 1643 500 +1143
plugin/skills/azure-deploy/references/pre-deploy-checklist.md 2881 2000 +881
plugin/skills/azure-deploy/references/recipes/azd/errors.md 3429 2000 +1429
plugin/skills/azure-deploy/references/troubleshooting.md 2038 2000 +38
plugin/skills/azure-diagnostics/SKILL.md 1132 500 +632
plugin/skills/azure-diagnostics/aks-troubleshooting/networking.md 2147 2000 +147
plugin/skills/azure-diagnostics/aks-troubleshooting/node-issues.md 2003 2000 +3
plugin/skills/azure-enterprise-infra-planner/SKILL.md 999 500 +499
plugin/skills/azure-enterprise-infra-planner/references/constraints/compute-apps.md 2022 2000 +22
plugin/skills/azure-hosted-copilot-sdk/SKILL.md 1260 500 +760
plugin/skills/azure-kubernetes/SKILL.md 2266 500 +1766
plugin/skills/azure-kusto/SKILL.md 2149 500 +1649
plugin/skills/azure-messaging/SKILL.md 967 500 +467
plugin/skills/azure-prepare/SKILL.md 2767 500 +2267
plugin/skills/azure-prepare/references/aspire.md 4003 2000 +2003
plugin/skills/azure-prepare/references/plan-template.md 2559 2000 +559
plugin/skills/azure-prepare/references/recipes/azd/aspire.md 3069 2000 +1069
plugin/skills/azure-prepare/references/recipes/azd/terraform.md 3012 2000 +1012
plugin/skills/azure-prepare/references/research.md 2217 2000 +217
plugin/skills/azure-prepare/references/resources-limits-quotas.md 3322 2000 +1322
plugin/skills/azure-prepare/references/security.md 2133 2000 +133
plugin/skills/azure-prepare/references/services/functions/bicep.md 3065 2000 +1065
plugin/skills/azure-prepare/references/services/functions/templates/SPEC-composable-templates.md 6187 2000 +4187
plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md 4649 2000 +2649
plugin/skills/azure-prepare/references/services/functions/terraform.md 3358 2000 +1358
plugin/skills/azure-quotas/SKILL.md 3445 500 +2945
plugin/skills/azure-quotas/references/commands.md 2644 2000 +644
plugin/skills/azure-resource-lookup/SKILL.md 1288 500 +788
plugin/skills/azure-resource-visualizer/SKILL.md 2054 500 +1554
plugin/skills/azure-storage/SKILL.md 1180 500 +680
plugin/skills/azure-upgrade/SKILL.md 1001 500 +501
plugin/skills/azure-upgrade/references/services/functions/automation.md 3463 2000 +1463
plugin/skills/azure-upgrade/references/services/functions/consumption-to-flex.md 2773 2000 +773
plugin/skills/azure-validate/SKILL.md 906 500 +406
plugin/skills/entra-app-registration/SKILL.md 2067 500 +1567
plugin/skills/entra-app-registration/references/api-permissions.md 2545 2000 +545
plugin/skills/entra-app-registration/references/cli-commands.md 2211 2000 +211
plugin/skills/entra-app-registration/references/console-app-example.md 2752 2000 +752
plugin/skills/entra-app-registration/references/oauth-flows.md 2375 2000 +375
plugin/skills/microsoft-foundry/SKILL.md 2870 500 +2370
plugin/skills/microsoft-foundry/foundry-agent/create/create.md 3016 2000 +1016
plugin/skills/microsoft-foundry/foundry-agent/deploy/deploy.md 5555 2000 +3555
plugin/skills/microsoft-foundry/foundry-agent/eval-datasets/eval-datasets.md 2342 2000 +342
plugin/skills/microsoft-foundry/foundry-agent/eval-datasets/references/trace-to-dataset.md 4268 2000 +2268
plugin/skills/microsoft-foundry/foundry-agent/observe/observe.md 2547 2000 +547
plugin/skills/microsoft-foundry/foundry-agent/trace/references/kql-templates.md 2701 2000 +701
plugin/skills/microsoft-foundry/foundry-agent/troubleshoot/troubleshoot.md 2164 2000 +164
plugin/skills/microsoft-foundry/models/deploy-model/SKILL.md 1640 500 +1140
plugin/skills/microsoft-foundry/models/deploy-model/capacity/SKILL.md 1739 500 +1239
plugin/skills/microsoft-foundry/models/deploy-model/customize/SKILL.md 2235 500 +1735
plugin/skills/microsoft-foundry/models/deploy-model/customize/references/customize-workflow.md 3335 2000 +1335
plugin/skills/microsoft-foundry/models/deploy-model/preset/SKILL.md 1226 500 +726
plugin/skills/microsoft-foundry/models/deploy-model/preset/references/preset-workflow.md 5534 2000 +3534
plugin/skills/microsoft-foundry/quota/quota.md 2288 2000 +288
plugin/skills/microsoft-foundry/quota/references/capacity-planning.md 2080 2000 +80
plugin/skills/microsoft-foundry/references/sdk/foundry-sdk-py.md 2162 2000 +162

Consider moving content to references/ subdirectories.


Automated token analysis. See skill authoring guidelines for best practices.

Removed PowerShell examples for listing and deleting container apps from the pre-deploy checklist.
@fanyang-mono fanyang-mono marked this pull request as ready for review April 7, 2026 16:22
Copilot AI review requested due to automatic review settings April 7, 2026 16:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a pre-deployment safeguard to prevent azd up from silently creating a new (unexpectedly named) Container Apps environment when one already exists in the target resource group, reducing long deployments and timeout risk.

Changes:

  • Adds a new mandatory “Step 5a” to detect existing Container Apps environments in the target RG and guide user resolution via ask_user.
  • Updates the “Common Mistakes to Avoid” table to include skipping the Container Apps environment check.
  • Bumps azure-deploy skill version to 1.0.16.
Show a summary per file
File Description
plugin/skills/azure-deploy/SKILL.md Version bump for the skill metadata.
plugin/skills/azure-deploy/references/pre-deploy-checklist.md Adds Container Apps environment conflict check step + common-mistake entry to prevent unexpected env creation/drift.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

…contradictory tip

Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/7264a5db-cb5b-400b-b876-85945239971d

Co-authored-by: fanyang-mono <52458914+fanyang-mono@users.noreply.github.com>
@fanyang-mono
Copy link
Copy Markdown
Contributor

@copilot bump 'azure-deploy' to 1.0.17

Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/fbd36d8f-e305-4d25-b014-a2665c299a9e

Co-authored-by: fanyang-mono <52458914+fanyang-mono@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 7, 2026 22:25
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 7, 2026

@copilot bump 'azure-deploy' to 1.0.17

Done in 09ca883 — version bumped to 1.0.17.

Copilot AI requested a review from fanyang-mono April 7, 2026 22:25
Copilot AI review requested due to automatic review settings April 7, 2026 22:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a pre-deployment checklist step to detect existing Azure Container Apps environments in the target resource group, preventing azd up from silently creating a new environment and causing longer deployments/timeouts.

Changes:

  • Introduces mandatory “Step 5a” to list Container Apps environments in the target RG and prompt the user with resolution options.
  • Adds a “Skipping Container Apps environment check” entry to the Common Mistakes table.
  • Bumps azure-deploy skill metadata version.
Show a summary per file
File Description
plugin/skills/azure-deploy/SKILL.md Updates skill metadata version.
plugin/skills/azure-deploy/references/pre-deploy-checklist.md Adds Container Apps environment conflict pre-check and documents it in Common Mistakes.

Copilot's findings

Comments suppressed due to low confidence (1)

plugin/skills/azure-deploy/references/pre-deploy-checklist.md:226

  • The new Common Mistakes row uses rg-<env> while the new Step 5a section uses rg-<env-name> (and Step 4 uses rg-<environment-name>). Please align this row’s placeholder with the convention used in the checklist steps so readers can copy/paste without guessing.
| Assuming location without checking RG | Check `az group show` before choosing |
| Ignoring tag conflicts in target RG | Check `az resource list --resource-group rg-<env>` before deploy |
| Skipping Container Apps environment check | Run `az containerapp env list --resource-group rg-<env>` before deploy (Step 5a) |
  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 7, 2026 22:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a pre-deployment checklist guardrail to detect and resolve Azure Container Apps environment name/resource-group conflicts before running azd up, helping prevent silent creation of unexpected Container Apps environments that can prolong deployments and cause drift/timeouts.

Changes:

  • Introduces a new mandatory “Step 5a” in the azure-deploy pre-deploy checklist to list existing Container Apps environments in the target resource group and prompt the user with resolution options.
  • Extends the “Common Mistakes to Avoid” table with a reminder to run the Container Apps environment check.
  • Bumps the azure-deploy skill metadata version.
Show a summary per file
File Description
plugin/skills/azure-deploy/SKILL.md Bumps skill version to reflect updated guidance.
plugin/skills/azure-deploy/references/pre-deploy-checklist.md Adds Container Apps environment conflict check + remediation options; updates common mistakes table.

Copilot's findings

Comments suppressed due to low confidence (1)

plugin/skills/azure-deploy/references/pre-deploy-checklist.md:226

  • The new Common Mistakes row suggests running az containerapp env list --resource-group rg-<env> unconditionally. Since Step 5a explicitly gates this check on the resource group already existing (Step 4), consider reflecting that in the table entry (e.g., "If rg-<env> exists, run...") to avoid reintroducing the earlier "RG not found" failure mode.
| Running `azd up` without environment | `azd env new <name>` first |
| Assuming location without checking RG | Check `az group show` before choosing |
| Ignoring tag conflicts in target RG | Check `az resource list --resource-group rg-<env>` before deploy |
| Skipping Container Apps environment check | Run `az containerapp env list --resource-group rg-<env>` before deploy (Step 5a) |
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

…ut pre-deploy-checklist.md

Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/c2dc1175-0890-411c-80eb-4406459e388d

Co-authored-by: fanyang-mono <52458914+fanyang-mono@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration test failure: azure-deploy – nodejs-demoapp brownfield javascript [Timeout]

3 participants