Add Container Apps and ARM error suggestions#7250
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances azd’s ARM deployment failure UX by adding targeted error-suggestion rules (with emphasis on Azure Container Apps) to the embedded error_suggestions.yaml, and updates/extends pipeline tests to cover the new match logic.
Changes:
- Added new YAML rules for
ContainerAppOperationError,InvalidTemplateDeployment(Container Apps-specific),RoleAssignmentExists, andInvalidResourceGroupLocation. - Refined the
RoleAssignmentExistsuser-facing message to better reflect “already configured” semantics. - Added unit tests for the new rule match scenarios and continued validation that the embedded YAML parses successfully.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cli/azd/resources/error_suggestions.yaml |
Adds/updates ARM + Container Apps error suggestion rules and guidance text. |
cli/azd/pkg/errorhandler/pipeline_test.go |
Updates an expected RBAC message and adds tests for Container Apps template errors and RG-location mismatch handling. |
Telemetry Context: Container Apps Is the #1 ARM Failure TargetThis PR's focus on Container Apps error suggestions is well-placed. Deep dive data (March 2026, 23 days): Container Apps dominates every error category
Most affected app patterns
Container Apps + Python is the single worst combination (771 errors, 249 machines). The .NET Container Apps errors are mostly from Specific Container Apps errors this PR's rules should help
These are all diagnosable at error-suggestion time. Nice coverage with the new rules. |
93c262d to
b0f96f9
Compare
b0f96f9 to
d119228
Compare
Add InvalidTemplateDeployment rule with container app pattern matching and InvalidResourceGroupLocation rule for region mismatch errors. Enhance ContainerAppOperationError suggestion with revision list command and networking/scaling guidance. Improve RoleAssignmentExists suggestion with retry guidance. Fixes #7249 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use >- block scalar to avoid line breaks splitting CLI commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Added error suggestion rules for 5 additional Container Apps error codes surfaced in telemetry analysis (per @spboyer review comment): - ContainerAppInvalidName (45 errors, 455s avg wait) - ManagedEnvironmentNotReadyForAppCreation (15 errors) - ManagedEnvironmentInvalidName (12 errors) - InvalidEnvironmentId (14 errors) - MaxNumberOfEnvsExceeded (quota errors) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d119228 to
81f71f5
Compare
Add lessons learned from recent PR reviews (#7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039) as agent instructions to prevent recurring review findings. New sections: - Error handling: ErrorWithSuggestion completeness, telemetry service attribution, scope-agnostic messages - Architecture boundaries: pkg/project target-agnostic, extension docs - Output formatting: shell-safe paths, consistent JSON contracts - Path safety: traversal validation, quoted paths in messages - Testing best practices: test actual rules, extract shared helpers, correct env vars, TypeScript patterns, efficient dir checks - CI/GitHub Actions: permissions, PATH handling, artifact downloads, prefer ADO for secrets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add lessons learned from team and Copilot reviews across PRs #7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039 as agent instructions to prevent recurring review findings. New/expanded sections: - Error handling: ErrorWithSuggestion field completeness, telemetry service attribution, scope-agnostic messages, link/suggestion parity, stale data in polling loops - Architecture boundaries: pkg/project target-agnostic, extension docs separation, env var verification against source code - Output formatting: shell-safe quoted paths, consistent JSON types - Path safety: traversal validation, quoted paths in messages - Code organization: extract shared logic across scopes - Documentation standards: help text consistency, no dead references, PR description accuracy - Testing best practices: test YAML rules e2e, extract shared helpers, correct env vars (AZD_FORCE_TTY, NO_COLOR), TypeScript patterns, reasonable timeouts, cross-platform paths, test new JSON fields - CI / GitHub Actions: permissions blocks, PATH handling, cross-workflow artifacts, prefer ADO for secrets, no placeholder steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Add lessons learned from team and Copilot reviews across PRs #7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039 as agent instructions to prevent recurring review findings. New/expanded sections: - Error handling: ErrorWithSuggestion field completeness, telemetry service attribution, scope-agnostic messages, link/suggestion parity, stale data in polling loops - Architecture boundaries: pkg/project target-agnostic, extension docs separation, env var verification against source code - Output formatting: shell-safe quoted paths, consistent JSON types - Path safety: traversal validation, quoted paths in messages - Code organization: extract shared logic across scopes - Documentation standards: help text consistency, no dead references, PR description accuracy - Testing best practices: test YAML rules e2e, extract shared helpers, correct env vars (AZD_FORCE_TTY, NO_COLOR), TypeScript patterns, reasonable timeouts, cross-platform paths, test new JSON fields - CI / GitHub Actions: permissions blocks, PATH handling, cross-workflow artifacts, prefer ADO for secrets, no placeholder steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add lessons learned from team and Copilot reviews across PRs #7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039 as agent instructions to prevent recurring review findings. New/expanded sections: - Error handling: ErrorWithSuggestion field completeness, telemetry service attribution, scope-agnostic messages, link/suggestion parity, stale data in polling loops - Architecture boundaries: pkg/project target-agnostic, extension docs separation, env var verification against source code - Output formatting: shell-safe quoted paths, consistent JSON types - Path safety: traversal validation, quoted paths in messages - Code organization: extract shared logic across scopes - Documentation standards: help text consistency, no dead references, PR description accuracy - Testing best practices: test YAML rules e2e, extract shared helpers, correct env vars (AZD_FORCE_TTY, NO_COLOR), TypeScript patterns, reasonable timeouts, cross-platform paths, test new JSON fields - CI / GitHub Actions: permissions blocks, PATH handling, cross-workflow artifacts, prefer ADO for secrets, no placeholder steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add lessons learned from team and Copilot reviews across PRs #7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039 as agent instructions to prevent recurring review findings. New/expanded sections: - Error handling: ErrorWithSuggestion field completeness, telemetry service attribution, scope-agnostic messages, link/suggestion parity, stale data in polling loops - Architecture boundaries: pkg/project target-agnostic, extension docs separation, env var verification against source code - Output formatting: shell-safe quoted paths, consistent JSON types - Path safety: traversal validation, quoted paths in messages - Code organization: extract shared logic across scopes - Documentation standards: help text consistency, no dead references, PR description accuracy - Testing best practices: test YAML rules e2e, extract shared helpers, correct env vars (AZD_FORCE_TTY, NO_COLOR), TypeScript patterns, reasonable timeouts, cross-platform paths, test new JSON fields - CI / GitHub Actions: permissions blocks, PATH handling, cross-workflow artifacts, prefer ADO for secrets, no placeholder steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Unreleased section to cli/azd/CHANGELOG.md documenting: - Azure#7236: azd auth status --output json agent-friendly improvements - Azure#7223: Function App .funcignore-aware remoteBuild defaulting - Azure#7293: Windows PowerShell daily install suggestion fix - Azure#7250: Container Apps and ARM error suggestion improvements - Add azure.ai.models extension v0.0.5-preview CHANGELOG entry for Azure#7279: 403 error handling improvements in custom create Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fixes #7249
Container Apps accounts for 41.5% of all ARM deployment failures (4,570 in March). This PR adds targeted error suggestions for the top Container Apps and ARM error codes that previously had no specific guidance.
New Error Rules
ContainerAppOperationErrorInvalidTemplateDeployment+ container appRoleAssignmentExistsInvalidResourceGroupLocationTest Coverage
TestPipeline_ContainerAppOperationError— verifies rule matchTestPipeline_InvalidTemplateDeployment_ContainerApp— verifies pattern + errorType combo match and negative case (non-CA template error)TestPipeline_InvalidResourceGroupLocation— verifies rule matchTestErrorSuggestionsYaml_IsValid— validates all YAML rules parse correctlyRelated