An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Hello Peter, The Azure Monitor Workspace defaultazuremonitorworkspace-weu (and its managed RG MA_defaultazuremonitorworkspace-weu_westeurope_managed) cannot be deleted because the AMCS control plane still holds an internal association reference to a DCR (collect-events-linux) whose resource group (AzureBackupRG_westus2_1) was deleted first. The error ExistingAssociationsPreventDelete fires because ARM validates associations during delete and blocks it even though the target DCR no longer exists anywhere in the subscription.
When an Azure Monitor Workspace is created, it auto-provisions a managed RG (MA_<name>_<location>_managed) with a Data Collection Endpoint (DCE) and a Data Collection Rule. Associations (DCRAs) between DCRs and DCEs/workspaces are stored as metadata on the target resource, not just on the DCR itself. When you deleted the resource group AzureBackupRG_westus2_1, ARM successfully removed the DCR and its resource group, but the association pointer on the workspace/DCE side was not cleaned up by the AMCS resource provider. This creates an orphaned reference that blocks all subsequent delete operations.
- You can try re-create the RG + DCR, Then Cascade-Delete (Still the Best Shot)
This approach works on the DCR side, not the workspace side, so the workspace's stuck Deleting state shouldn't block it. The idea is to make ARM "see" the phantom DCR again so the ?deleteAssociations=true parameter can clean up the orphaned association metadata.
# 1. Recreate the resource group
az group create --name "AzureBackupRG_westus2_1" --location "westus2"
# 2. Recreate the DCR via REST PUT (minimal body — just needs to exist at the exact resource ID)
az rest --method PUT \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/AzureBackupRG_westus2_1/providers/Microsoft.Insights/dataCollectionRules/collect-events-linux?api-version=2023-03-11" \
--body '{
"location": "westus2",
"properties": {
"dataFlows": [{"streams":["Microsoft-Syslog"],"destinations":["dest1"]}],
"destinations": {
"logAnalytics": [{
"workspaceResourceId": "/subscriptions/{sub-id}/resourceGroups/{any-existing-rg}/providers/Microsoft.OperationalInsights/workspaces/{any-existing-workspace}",
"name": "dest1"
}]
}
}
}'
# 3. Delete the DCR with cascading association cleanup
az rest --method DELETE \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/AzureBackupRG_westus2_1/providers/Microsoft.Insights/dataCollectionRules/collect-events-linux?api-version=2024-03-11&deleteAssociations=true"
# 4. Retry deleting the Azure Monitor Workspace
az rest --method DELETE \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Monitor/accounts/defaultazuremonitorworkspace-weu?api-version=2023-04-03"
# 5. Clean up
az group delete --name "AzureBackupRG_westus2_1" --yes --no-wait
If step 2 fails because the DCR PUT requires a valid Log Analytics workspace destination, you can create a temporary throwaway workspace first, reference it, then clean up after.
- Use Azure Resource Explorer to Find & Delete the Orphaned Association Directly
The Q&A moderator for the identical DCE/AMPLS orphan case specifically recommended using https://resources.azure.com to locate and manually delete orphaned associations that aren't visible through CLI or portal.
- Go to https://resources.azure.com
- Navigate to:
-
subscriptions/{sub-id}/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Monitor/accounts/defaultazuremonitorworkspace-weu - Also check:
subscriptions/{sub-id}/resourceGroups/MA_defaultazuremonitorworkspace-weu_westeurope_managed/providers/Microsoft.Insights/dataCollectionEndpoints/{dce-name}
-
- Expand each resource and look for a child node called
providers/Microsoft.Insights/dataCollectionRuleAssociations - If you find the orphaned association referencing
collect-events-linux, try DELETE directly from Resource Explorer
Also try the direct REST call to list associations on the DCE inside the managed RG:
# List all DCRA children on the DCE
az rest --method GET \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/MA_defaultazuremonitorworkspace-weu_westeurope_managed/providers/Microsoft.Insights/dataCollectionEndpoints/{dce-name}/providers/Microsoft.Insights/dataCollectionRuleAssociations?api-version=2023-03-11"
# List all DCRA children on the workspace itself
az rest --method GET \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Monitor/accounts/defaultazuremonitorworkspace-weu/providers/Microsoft.Insights/dataCollectionRuleAssociations?api-version=2023-03-11"
If any association IDs appear, delete them directly:
az rest --method DELETE \
--url "{full-association-resource-id}?api-version=2023-03-11"
Hope this helps! Please let us if you still facing an issue. Thanks