Repository navigation
Delete the log workspace permanently when tearing down - #173
Merged
Merged
Conversation
Deleting the resource group only soft-deletes its Log Analytics workspace. A deployment within the next 14 days recovers the old workspace instead of creating one, and for its first minutes the recovered workspace has no container tables: the log collection rule fails with InvalidOutputTable. Microsoft's guidance for environments redeployed under the same name is to delete the workspace permanently, so the destroy workflow and the documented manual steps now do that before deleting the group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
jaredthivener
added a commit
that referenced
this pull request
Oct 7, 2026
…178) The Destroy workflow failed in the step added by #173. On GitHub's runners, `az monitor log-analytics workspace delete` crashed inside the Azure CLI before sending anything: deadlock detected by _ModuleLock('requests.structures') That is Azure/azure-cli#33996, open and unfixed: with the CLI's bundled Python 3.14, long-running commands create their credential on a worker thread, and its import of `requests` intermittently collides with the main thread's. The step now sends the same permanent delete as a REST call through `az rest`, which has no worker thread, and waits for the workspace to be gone before the group is deleted. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first attempt of today's Deploy run failed with:
Cause
The environment had been torn down a few hours earlier with
az group delete, which is also all the Destroy workflow does. That only soft-deletes the Log Analytics workspace. Per Microsoft's page on deleting and recovering workspaces:--force).What was observed: the tables were missing when the first attempt created the collection rule, about a minute after the recovery, and present eight minutes later, when the workflow's second attempt created the same rule successfully. No Microsoft page I found documents this exact error for this case, so the link between the two is an inference from that timing.
Change
--forcebefore deleting the group.infra/README.mdgives the same two commands for a manual teardown, and says what happens otherwise.Not tested
The new step has not run: it would delete the workspace the live environment is using. Its list query returns the right workspace against the live group. The current deployment needs nothing from this; its retry already got past the error.
🤖 Generated with Claude Code