Add Deployment TSG: clean up an existing Azure Local deployment before redeployment - #313
Add Deployment TSG: clean up an existing Azure Local deployment before redeployment#313AlBurns-MSFT wants to merge 6 commits into
Conversation
Adds a HowTo guide for TSG/Deployment covering the dependency-safe order to delete a prior deployment's Azure resources before reimaging and redeploying, so workload resources are removed before the Arc resource bridge and custom location and no cloud resources are orphaned. - Workload resources first (inside-out: disks/NICs before storage paths/logical networks), then Arc resource bridge, then custom location, then infrastructure - Azure Resource Graph checkpoint (extendedLocation.name) to catch cross-RG dependents before deleting the platform resources - Key Vault soft-delete/purge, ReadOnly/inherited locks, and stale Arc machine notes; no 22H2-era unregister cmdlet (23H2 removes the cluster via the Azure Local resource) - Indexed in TSG/Deployment/README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Step 3: deleting an Azure Local VM does not remove its network interfaces or data disks (delete them separately; add "Show hidden types" tip) -- per the Manage Azure Local VMs documentation. - Step 4: cite the authoritative source for the Arc-resource-bridge-then-custom- location order (What is Azure Local VM management?) and note that az arcappliance delete hci is the supported bridge teardown. - Replace two internal "Azure Local VMs wiki" references (not customer-accessible) with the Step 6 reimage and, for the no-reimage case, contact Microsoft Support. - Add an Azure Resource Graph checkpoint caveat (scope = Directory, eventual- consistency lag) so a false "zero rows" cannot greenlight the irreversible delete. - Soften "no separate unregister cmdlet" (Unregister-AzStackHCI still exists). - Correct resource-lock inheritance scope (subscription, not management group). - Widen the orphaned-VM workaround gating (the VM image and custom location must also still exist to recreate the VM).
There was a problem hiding this comment.
Pull request overview
This PR adds a new Deployment How-To guide documenting how to clean up an existing Azure Local (23H2+) deployment before redeployment. It fills a gap in the official Decommission Azure Local documentation by prescribing a dependency-safe deletion order (workload resources → Arc resource bridge → custom location → infrastructure/registration resources), a cross-resource-group dependency checkpoint, CLI equivalents, verification, and troubleshooting. The guide follows the repository's HowTo-Template.md structure and is registered in the Deployment component index.
Changes:
- Adds
HowTo-Deployment-CleanUpBeforeRedeployment.md, a step-by-step TSG covering resource inventory, lock removal, ordered deletion, reimaging, verification, and troubleshooting. - Registers the new guide in
TSG/Deployment/README.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
TSG/Deployment/HowTo-Deployment-CleanUpBeforeRedeployment.md |
New How-To guide detailing the dependency-safe cleanup procedure for redeploying Azure Local; follows the repo How-To template with valid TOC anchors, internal/external links, and CLI examples. |
TSG/Deployment/README.md |
Adds an index entry linking to the new guide, consistent with existing entries. |
I reviewed the template compliance, naming convention, README index entry, internal link (../ArcVMs/arc-vm-deletion.md exists), TOC anchor accuracy, external links (no version references), and CLI command accuracy. No blocking issues were found. Note that the guide documents destructive and irreversible Azure operations (deleting the Arc resource bridge, custom location, key vaults, and resource groups; purging soft-deleted vaults), so final technical validation against current Azure behavior is best confirmed by a human reviewer.
aldawson33
left a comment
There was a problem hiding this comment.
The depth of this TSG does a great job of supplementing the 'official' procedure.
|
TSG grader results, clean up a deployment before redeployment I ran this through our TSG grader (static structure/safety lint plus a 13-reader persona usability panel). Strong, careful How-To: static lint B, usability 4.0/5. This is a procedural teardown, so there is no live inject/detect/mitigate loop to run; the feedback is doc usability plus one lint note. Lint note (both warnings are doc-type artifacts, no action needed). The lint flagged "no symptoms section" and "no verify-the-fix step." The first does not apply to a How-To (there is no failure to symptomatize), and the guide does have a Usability work items (highest-leverage first).
Nice touches already: the inside-out deletion order with the zero-rows Resource Graph checkpoint, the |
|
Ran the 13-reader usability panel on this one: 4.0/5, a strong How-To. The dependency-safe inside-out deletion order, the zero-rows extendedLocation Resource Graph checkpoint, the Five reader-driven items would take it to 5/5:
Optional polish from a reader already at 5: list the node-side EventIDs / logs to capture if a delete hangs. No correctness issues, this is all usability. |
- Add at-a-glance rows to the header table (who runs it, reversibility, impact/downtime, estimated time) - Add a Glossary (Arc resource bridge, custom location, extendedLocation, soft-delete vs. purge) and register it in the TOC - Replace the Step 3 prose CLI description with an exact copy-paste `az stack-hci-vm` delete block, one verified command per resource type, in the inside-out deletion order - Add a back-up-your-workload-data warning before the Step 3 deletes - Cross-link Step 6 to the "Install the Azure Local operating system" doc Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pushed a commit addressing the usability feedback:
I left out the optional "node-side EventIDs if a delete hangs" idea — I didn't have verified EventIDs and didn't want to publish unverified identifiers. |
|
I would like to add that the installation also creates a number of permission which then sprawl, especially seen on testing subscriptions. Often these result into objects that cannot be resolved by Entra similar to unresolved SIDs in AD. Personally I would appreciate a full script provided by Microsoft, at best as text for copy paste to az cli. I am aware Portal changes often take a long time to come to prod for good reasons, so an aka.ms link in Port to TSG would be my preference. Risk: sometimes customers may use the witness storage account for multiple things. Please check if the intention of cleanup is as thorough as intended. |
…autions Addresses the PR review (Karl-WE): the cleanup guide covered Azure resources but not the objects a resource-group delete leaves behind. Adds, grounded in Microsoft docs and a live read-only inspection of a real deployment: - Step 1: callout that a deployment also creates Entra role assignments/identities, Azure Monitor config, and on-prem AD objects (not removed by an RG delete). - Step 5b: untie Azure Monitor / Insights (DCR associations -> DCRs -> DCEs -> workspace) and, if enabled, Azure Backup (vault won't delete with soft-deleted items). - Step 5c: remove orphaned "Identity not found" role assignments and the throwaway deployment principal; do NOT remove first-party RP service principals. - Step 5d: clean up the on-prem AD OU/CNO/node/CAU/user objects, with a BitLocker recovery-key export warning before the recursive OU delete. - Step 5: cloud-witness storage reuse + 2-node quorum caution. - RG-delete note: those out-of-RG objects still require Steps 5b-5d. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n filter, warn on backup-data deletion - Step 5b: associations are child resources removed with the machine (disabling Insights deletes them); drop the association delete commands and reword the survivors (DCRs/DCEs/alert rules/workspace/ingested data). - Step 5b: raise the Azure Backup note to a WARNING; --delete-backup-data is irreversible and may be the last copy after Step 3. - Step 5c: add an Entra directory-read precondition and a per-principal existence check (az ad sp/user show) before deleting, so an empty principalName from missing directory-read is not mistaken for orphans. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… guard, fix prerequisites A source pass (public Windows AD docs + product source) and a fresh-SRE walkthrough of the assembled doc drove these corrections: - Step 5d: clear ProtectedFromAccidentalDeletion across the whole OU subtree (clearing the OU alone fails with Access Denied on any protected descendant), and add verify-scope-first, a -WhatIf preview, and a commented-out delete so copy-paste cannot over-scope the recursive removal. - Step 5d: state it always applies (Azure Local 23H2 requires AD DS); realistic DN. - Step 5c: separate operator-prerequisite roles (Owner or Contributor+UAA, RG-scoped) from deployment-created RG-scoped grants; surface the role-assignment id the delete needs. - Prerequisites: Contributor alone cannot remove locks or role assignments; add Entra directory-read, Application/User Administrator, and the AD RSAT module. - Step 3: warn that Azure Backup is the last copy, destroyed in Step 5b. - Step 5b: cascade wording, DCR/DCE discovery hints, illustrative-command note. Lint clean, fences balanced, anchors map, guarded AD block parses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed the review in the latest push. What was added, for the objects a resource-group delete leaves behind:
Commands are provided per step and marked to validate in-environment first; I did not exercise a full teardown end to end. The portal wipe-and-redeploy button is a product ask rather than a doc change, so it is out of scope for this TSG. |
What
Adds a Deployment TSG documenting how to clean up an existing Azure Local (23H2+) deployment before redeployment: delete the Azure resources a deployment creates in a dependency-safe order (workload resources, then the Arc resource bridge, then the custom location, then the infrastructure resources), then reimage and redeploy.
This is a thinly documented procedure. The official Decommission Azure Local doc lists the resources to remove but not the deletion order, the cross-resource-group dependency check, or the CLI, verification, and troubleshooting steps this guide adds.
Files
TSG/Deployment/HowTo-Deployment-CleanUpBeforeRedeployment.md— new TSGTSG/Deployment/README.md— registers the TSG in the Deployment indexValidation
Every claim was checked against Microsoft Learn, the Azure CLI reference, and the product docs; the on-cluster behaviors were confirmed against a live deployed Azure Local cluster.
az arcappliance delete hci --config-file,az customlocation delete,az keyvault purge, theaz stack-hci-vmdelete subgroups, and theaz stack-hci-vm nic(attach/detach) vsaz stack-hci-vm network nic(resource) distinction.*-control-plane-*) confirmed live:Get-VMon a deployed cluster returns a<GUID>-control-plane-0-<GUID>VM.