skip to content
Alvin Lucillo

Error deleting a Microsoft Foundry account

/ 1 min read

If you encounter an error below when deleting a Microsoft Foundry resource, it means it’s already soft-deleted.

az cognitiveservices account create \
  --name "foundry-resource-aks-deploy" \
  --resource-group "rg-aks-deploy" \
  --location "centralindia" \
  --custom-domain "foundry-resource-aks-deploy" \
  --kind "AIServices" \
  --sku "s0" \
  --yes > output
ERROR: (FlagMustBeSetForRestore) An existing resource with ID '/subscriptions/00000000-0000-4000-8000-000000000000/resourceGroups/rg-foundry-demo/providers/Microsoft.CognitiveServices/accounts/foundry-demo-a1b2c3' has been soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first.
Code: FlagMustBeSetForRestore
Message: An existing resource with ID '/subscriptions/00000000-0000-4000-8000-000000000000/resourceGroups/rg-foundry-demo/providers/Microsoft.CognitiveServices/accounts/foundry-demo-a1b2c3' has been soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first.