Recover deleted Cognitive Services resources
This article provides instructions on how to recover a Cognitive Services resource that is already deleted. The article also provides instructions on how to purge a deleted resource.
Note
The instructions in this article are applicable to both a multi-service resource and a single-service resource. A multi-service resource enables access to multiple cognitive services using a single key and endpoint. On the other hand, a single-service resource enables access to just that specific cognitive service for which the resource was created.
Prerequisites
- The resource to be recovered must have been deleted within the past 48 hours.
- The resource to be recovered must not have been purged already. A purged resource cannot be recovered.
- Before you attempt to recover a deleted resource, make sure that the resource group for that account exists. If the resource group was deleted, you must recreate it. Recovering a resource group is not possible. For more information, see Manage resource groups.
- If the deleted resource used customer-managed keys with Azure Key Vault and the key vault has also been deleted, then you must restore the key vault before you restore the Cognitive Services resource. For more information, see Azure Key Vault recovery management.
- If the deleted resource used a customer-managed storage and storage account has also been deleted, you must restore the storage account before you restore the Cognitive Services resource. For instructions, see Recover a deleted storage account.
Your subscription must have Microsoft.CognitiveServices/locations/resourceGroups/deletedAccounts/delete
permissions to purge resources, such as Cognitive Services Contributor or Contributor.
Recover a deleted resource
To recover a deleted cognitive service resource, use the following commands. Where applicable, replace:
{subscriptionID}
with your Azure subscription ID{resourceGroup}
with your resource group{resourceName}
with your resource name{location}
with the location of your resource
If you need to recover a deleted resource, navigate to the hub of the cognitive services API type and select "Manage deleted resources" from the menu. For example, if you would like to recover an "Anomaly detector" resource, search for "Anomaly detector" in the search bar and select the service to get to the "Anomaly detector" hub which lists deleted resources.
Select the subscription in the dropdown list to locate the deleted resource you would like to recover. Select one or more of the deleted resources and click Recover.
Note
It can take a couple of minutes for your deleted resource(s) to recover and show up in the list of the resources. Click on the Refresh button in the menu to update the list of resources.
Purge a deleted resource
Once you delete a resource, you won't be able to create another one with the same name for 48 hours. To create a resource with the same name, you will need to purge the deleted resource.
To purge a deleted cognitive service resource, use the following commands. Where applicable, replace:
{subscriptionID}
with your Azure subscription ID{resourceGroup}
with your resource group{resourceName}
with your resource name{location}
with the location of your resource
Note
Once a resource is purged, it is permanently deleted and cannot be restored. You will lose all data and keys associated with the resource.
If you need to purge a deleted resource, the steps are similar to recovering a deleted resource.
Navigate to the hub of the cognitive services API type of your deleted resource. For example, if you would like to purge an "Anomaly detector" resource, search for "Anomaly detector" in the search bar. Select the service to get to the "Anomaly detector" hub which lists deleted resources.
Select Manage deleted resources from the menu.
Select the subscription in the dropdown list to locate the deleted resource you would like to purge. Select one or more deleted resources and click Purge. Purging will permanently delete a Cognitive Services resource.
See also
Feedback
Submit and view feedback for