Add authorization failure hints for ARM deployments#6802
Add authorization failure hints for ARM deployments#6802spboyer wants to merge 1 commit intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds authorization failure hints for ARM deployments to help users resolve common permission issues. When a deployment fails with authorization-related errors, the system displays actionable guidance messages mapped to specific ARM error codes.
Changes:
- Introduces
auth_hint.gowith error code to hint mappings for 5 ARM authorization error codes plus special handling for RoleAssignmentExists and Forbidden with roleAssignment context - Adds comprehensive unit tests in
auth_hint_test.gowith 13 table-driven test cases - Integrates hint display into
ErrorMiddleware.Run()to show hints when deployment errors occur
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| cli/azd/cmd/middleware/auth_hint.go | Maps ARM authorization error codes to actionable user guidance with recursive error tree traversal |
| cli/azd/cmd/middleware/auth_hint_test.go | Comprehensive unit tests covering all error codes, nested errors, and edge cases |
| cli/azd/cmd/middleware/error.go | Integrates auth hint display into error handling middleware using WithWarningFormat |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f49fdaf to
03f11a0
Compare
03f11a0 to
1ecc710
Compare
Detect common authorization-related ARM error codes (AuthorizationFailed, NoRegisteredProviderFound, PrincipalNotFound, RoleAssignmentExists) in deployment errors and display actionable guidance to help users resolve permission issues. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1ecc710 to
585b25f
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
Detects common authorization-related ARM error codes in deployment errors and displays actionable guidance to help users resolve permission issues.
Fixes #6798
Changes
auth_hint.go (new)
auth_hint_test.go (new)
error.go
Data Context
Authorization errors account for 2.68% of all azd errors (~3,432). AI templates hit 4.84%.