-
Notifications
You must be signed in to change notification settings - Fork 267
add purge support for log analytics #6566
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
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 adds support for purging Log Analytics Workspaces during resource destruction in the Azure Developer CLI. When resources are destroyed with the purge option enabled, Log Analytics Workspaces will now be permanently deleted (using the Force option) rather than soft-deleted.
Changes:
- Added new Azure SDK dependency for operational insights to support Log Analytics Workspace operations
- Implemented Log Analytics Workspace purge functionality that uses the Force delete option to bypass soft-delete
- Integrated Log Analytics purge into the Bicep provider's destroy workflow
- Updated Go module dependencies (go mod tidy)
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| cli/azd/pkg/azapi/log_analytics.go | New file implementing Log Analytics Workspace client operations (Get, Purge, and client creation) |
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go | Integrated Log Analytics purge into destroyDeployment function; added getLogAnalyticsWorkspacesToPurge and purgeLogAnalyticsWorkspaces functions |
| cli/azd/go.mod | Added armoperationalinsights/v2 dependency; moved jsonschema from indirect to direct; updated various transitive dependencies |
| cli/azd/go.sum | Updated checksums for new and updated dependencies |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix #5080
This pull request adds support for purging Azure Log Analytics Workspaces during resource group deletion in the Bicep infrastructure provider. The main changes include introducing new methods for identifying and purging Log Analytics Workspaces, updating the destroy logic to handle these resources, and updating dependencies to support the new functionality.
Log Analytics Workspace Purge Support:
AzCliLogAnalyticsWorkspacestruct and related methods toazapi/log_analytics.gofor retrieving and purging Log Analytics Workspaces using the Azure SDK.getLogAnalyticsWorkspacesToPurgeandpurgeLogAnalyticsWorkspacesmethods inbicep_provider.goto identify and purge Log Analytics Workspaces before deleting the resource group. [1] [2]destroyDeploymentlogic to handle Log Analytics Workspace purge when the purge option is enabled, ensuring these resources are purged before resource group deletion.Destroymethod to collect Log Analytics Workspaces to purge and pass them to the destroy logic. [1] [2] [3]Dependency Updates:
go.modto add the Azure Operational Insights SDK and other dependencies required for Log Analytics Workspace management, as well as version bumps for several indirect dependencies. [1] [2] [3] [4] [5]Checked in log analytics workspace recycle bin that the workspace is purged.
