Skip to content

Commit 9045f09

Browse files
Merge pull request #206737 from MikiaC/recovery-of-cognitive-service-resources
adding tabs
2 parents 9a3d928 + c4cbebc commit 9045f09

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

articles/cognitive-services/manage-resources.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,21 @@ To recover a deleted cognitive service resource, use the following commands. Whe
3737
* `{resourceName}` with your resource name
3838
* `{location}` with the location of your resource
3939

40-
### Using the REST API
40+
41+
# [Azure portal](#tab/azure-portal)
42+
43+
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.
44+
45+
:::image type="content" source="media/recovery-deleted-resource.png" alt-text="A screenshot showing the Anomaly detector hub, which lets you recover deleted resources." lightbox="media/recovery-deleted-resource.png":::
46+
47+
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**.
48+
49+
:::image type="content" source="media/managing-deleted-resource.png" alt-text="A screenshot showing deleted resources you can recover." lightbox="media/managing-deleted-resource.png":::
50+
51+
> [!NOTE]
52+
> 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.
53+
54+
# [Rest API](#tab/rest-api)
4155

4256
Use the following `PUT` command:
4357

@@ -56,7 +70,7 @@ In the request body, use the following JSON format:
5670
}
5771
```
5872

59-
### Using PowerShell
73+
# [PowerShell](#tab/powershell)
6074

6175
Use the following command to restore the resource:
6276

@@ -70,12 +84,14 @@ If you need to find the name of your deleted resources, you can get a list of de
7084
Get-AzResource -ResourceId /subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts -ApiVersion 2021-04-30
7185
```
7286

73-
### Using the Azure CLI
87+
# [Azure CLI](#tab/azure-cli)
7488

7589
```azurecli-interactive
7690
az resource create --subscription {subscriptionID} -g {resourceGroup} -n {resourceName} --location {location} --namespace Microsoft.CognitiveServices --resource-type accounts --properties "{\"restore\": true}"
7791
```
7892

93+
---
94+
7995
## Purge a deleted resource
8096

8197
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.
@@ -90,28 +106,49 @@ To purge a deleted cognitive service resource, use the following commands. Where
90106
> [!NOTE]
91107
> Once a resource is purged, it is permanently deleted and cannot be restored. You will lose all data and keys associated with the resource.
92108
93-
### Using the REST API
109+
110+
# [Azure portal](#tab/azure-portal)
111+
112+
If you need to purge a deleted resource, the steps are similar to recovering a deleted resource.
113+
114+
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.
115+
116+
Select **Manage deleted resources** from the menu.
117+
118+
:::image type="content" source="media/recovery-deleted-resource.png" alt-text="A screenshot showing the Anomaly detector hub, which lets you purge deleted resources." lightbox="media/recovery-deleted-resource.png":::
119+
120+
Select the subscription in the dropdown list to locate the deleted resource you would like to purge.
121+
Select one or more deleted resources and click **Purge**.
122+
Purging will permanently delete a Cognitive Services resource.
123+
124+
:::image type="content" source="media/managing-deleted-resource.png" alt-text="A screenshot showing a list of resources that can be purged." lightbox="media/managing-deleted-resource.png":::
125+
126+
127+
# [Rest API](#tab/rest-api)
94128

95129
Use the following `DELETE` command:
96130

97131
```rest-api
98132
https://management.azure.com/subscriptions/{subscriptionID}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroup}/deletedAccounts/{resourceName}?Api-Version=2021-04-30`
99133
```
100134

101-
### Using PowerShell
135+
# [PowerShell](#tab/powershell)
102136

103137
```powershell
104138
Remove-AzResource -ResourceId /subscriptions/{subscriptionID}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroup}/deletedAccounts/{resourceName} -ApiVersion 2021-04-30`
105139
```
106140

107-
### Using the Azure CLI
141+
# [Azure CLI](#tab/azure-cli)
108142

109143
```azurecli-interactive
110144
az resource delete --ids /subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroup}/deletedAccounts/{resourceName}
111145
```
112146

147+
---
148+
149+
113150
## See also
114151
* [Create a new resource using the Azure portal](cognitive-services-apis-create-account.md)
115152
* [Create a new resource using the Azure CLI](cognitive-services-apis-create-account-cli.md)
116153
* [Create a new resource using the client library](cognitive-services-apis-create-account-client-library.md)
117-
* [Create a new resource using an ARM template](create-account-resource-manager-template.md)
154+
* [Create a new resource using an ARM template](create-account-resource-manager-template.md)
501 KB
Loading
330 KB
Loading

0 commit comments

Comments
 (0)