-
Notifications
You must be signed in to change notification settings - Fork 259
Fix azd down to void deployment state when resources are manually deleted #6267
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
base: main
Are you sure you want to change the base?
Conversation
…eted Extract state voiding logic into separate method and ensure it runs even when no resources are found. This allows azd down to properly clean deployment state when resources have been manually deleted. Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
|
|
||
| // destroyDeploymentWithoutConfirmation deletes the deployment without prompting for confirmation. | ||
| // This is used when there are no resources to delete but we still need to void the deployment state. | ||
| func (p *BicepProvider) destroyDeploymentWithoutConfirmation( |
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.
The implementation of the delete logic is duplicated across destroyDeploymentWithConfirmation and destroyDeploymentWithoutConfirmation. Consider refactoring slightly to remove the duplication.
I would recommend having a single destroyDeployment, and factor out the confirmation prompt logic as promptDeletion.
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.
@copilot ^
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.
Refactored to have a single destroyDeployment method and a separate promptDeletion method to handle the confirmation prompt. This removes the duplication. See commit 028bfc0.
…ve duplication Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Fix azd down to void deployment state even when resources are already deleted
This PR addresses issue #6207 where
azd downfails to void the deployment state when resource groups have been manually deleted.Plan:
Changes Made:
standard_deployments.govoidSubscriptionDeploymentStatemethod fromDeleteSubscriptionDeploymentbicep_provider.goDestroymethod to handle the case when no resources are foundpromptDeletion- handles user confirmation promptdestroyDeployment- single method for the actual deletion logic (no duplication)Test Results:
Scope:
This change only applies to:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.