-
Notifications
You must be signed in to change notification settings - Fork 268
Dynamically resolve resource display name in azd down
#6452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances azd down to dynamically resolve resource display names by querying Azure resource properties, fixing incorrect resource type displays (e.g., Function Apps incorrectly shown as "Web Apps").
Key Changes:
- Added
ResourceManagerdependency toBicepProviderfor dynamic resource type resolution - Modified
generateResourcesToDeleteto query Azure for accurate resource display names based on resource properties - Updated all tests with proper mock implementation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go | Added ResourceManager field and parameter to constructor; updated generateResourcesToDelete to use dynamic lookup with fallback to static lookup on error |
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider_test.go | Added mockResourceManager implementation and updated test instantiations to include the new parameter |
01d1cfd to
e2a3f69
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
|
Fixes #5825
This PR enhances the
azd downpreview to dynamically resolve resource names.Problem
When running
azd downon a Function App, the resource may inaccurately be displayed as "Web App" because thegenerateResourcesToDeletefunction used a static lookup that doesn't differentiate between different kinds ofMicrosoft.Web/sitesresources. Other resources types likeMicrosoft.CognitiveServices/accountsalso have this issue.Solution
Updated
BicepProviderto use the dynamicResourceManager.GetResourceTypeDisplayName()method, which queries the Azure resource properties to determine the correct display name based on the resource'sKindproperty (e.g., "functionapp" → "Function App").Validation