| **FlagMustBeSetForRestore/<br>NameUnavailable/CustomDomainInUse** | Soft-deleted resource requires restore flag or purge | This error occurs when you try to deploy a Cognitive Services resource that was **soft-deleted** earlier. Azure requires you to explicitly set the **`restore` flag** to `true` if you want to recover the soft-deleted resource. If you don't want to restore the resource, you must **purge the deleted resource** first before redeploying.<br><br>**Example causes:**<br><ul><li>Trying to redeploy a Cognitive Services account with the same name as a previously deleted one</li><li>The deleted resource still exists in a **soft-delete retention state**</li></ul><br>**How to fix:**<br><ul><li>If you want to restore → add `"restore": true` in your template properties</li><li>If you want a fresh deployment → purge the resource using:<br>`az cognitiveservices account purge --name <resource-name> --resource-group <resource-group> --location <location>`</li><li>For more details, refer to [Soft delete and resource restore](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/delete-resource-group?tabs=azure-powershell)</li></ul> |
0 commit comments