Skip to content

Commit baa9289

Browse files
Merge pull request #333 from microsoft/psl-loganalyticsdeletion-guide
feat: Add Troubleshooting Guide for Log Analytics Workspace Deletion Issue
2 parents 160439d + cc6d519 commit baa9289

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

docs/DeploymentGuide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ azd down --force --purge
462462
463463
> **Tip:** If you have old environments that failed deployment or are no longer needed, use the commands above to clean them up before creating new ones.
464464
465+
> **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`.
466+
465467
### 🗑️ Azure Resource Group Cleanup
466468
467469
**To clean up Azure resource groups (if needed):**
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 🛠 Handling Log Analytics Workspace Deletion with Replication Enabled
2+
3+
If redundancy (replication) is enabled for your Log Analytics workspace, you must disable it before deleting the workspace or resource group. Otherwise, deletion will fail.
4+
5+
## ✅ Steps to Disable Replication Before Deletion
6+
Run the following Azure CLI command. Note: This operation may take about 5 minutes to complete.
7+
8+
```bash
9+
az resource update --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --set properties.replication.enabled=false
10+
```
11+
12+
Replace:
13+
- `{subscriptionId}` → Your Azure subscription ID
14+
- `{resourceGroupName}` → The name of your resource group
15+
- `{logAnalyticsName}` → The name of your Log Analytics workspace
16+
17+
Optional: Verify replication disabled (should output `false`):
18+
```bash
19+
az resource show --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --query properties.replication.enabled -o tsv
20+
```
21+
22+
## ✅ After Disabling Replication
23+
You can safely delete:
24+
- The Log Analytics workspace (manual)
25+
- The resource group (manual), or
26+
- All provisioned resources via `azd down`
27+
28+
Return to: [Deployment Guide](./DeploymentGuide.md)

0 commit comments

Comments
 (0)