Skip to content

Commit 97ff4c1

Browse files
authored
Add policy removal, like in AKS baseline
1 parent 6afe49a commit 97ff4c1

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,29 @@ Most Azure resources deployed in the prior steps will incur ongoing charges unle
330330
331331
Additionally, a few of the resources deployed enter soft delete status which will restrict the ability to redeploy another resource with the same name or DNS entry; and might not release quota. It's best to purge any soft deleted resources once you are done exploring. Use the following commands to delete the deployed resources and resource group and to purge each of the resources with soft delete.
332332

333-
| :warning: | This will completely delete any data you may have included in this example. That data and this deployment will be unrecoverable. |
334-
| :-------: | :------------------------- |
333+
1. Delete the resource group as a way to delete all contained Azure resources.
335334

336-
```bash
337-
# These deletes and purges take about 30 minutes to run.
335+
| :warning: | This will completely delete any data you may have included in this example. That data and this deployment will be unrecoverable. |
336+
| :-------: | :------------------------- |
338337

339-
# This command will delete most of the resources, but will error out. That's expected.
340-
az group delete -n $RESOURCE_GROUP -y
338+
:clock8: *This might take about 20 minutes.*
341339

342-
# Continue, even if the previous command errored. Purge the soft delete resources.
343-
az keyvault purge -n kv-${BASE_NAME} -l $LOCATION
344-
az cognitiveservices account purge -g $RESOURCE_GROUP -l $LOCATION -n aif${BASE_NAME}
345-
```
340+
```bash
341+
# This command will delete most of the resources, but will sometimes error out. That's expected.
342+
az group delete -n $RESOURCE_GROUP -y
343+
344+
# Continue, even if the previous command errored. Purge the soft delete resources.
345+
```
346+
347+
1. Purge soft-deleted resources.
348+
349+
```bash
350+
# Purge the soft delete resources.
351+
az keyvault purge -n kv-${BASE_NAME} -l $LOCATION
352+
az cognitiveservices account purge -g $RESOURCE_GROUP -l $LOCATION -n aif${BASE_NAME}
353+
```
354+
355+
1. [Remove the Azure Policy assignments](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyMenuBlade/Compliance) scoped to the resource group. To identify those created by this implementation, look for ones that are prefixed with `[BASE_NAME] `.
346356

347357
> [!TIP]
348358
> The `vnet-workload` and associated networking resources are sometimes blocked from being deleted with the above instructions. This is because the Azure AI Agent subnet (`snet-agentsEgress`) retains a latent Microsoft-managed deletgated connection (`serviceAssociationLink`) to the deleted AI Agent service backend. The virtual network and associated resources typically become free to delete about an hour after purging the Azure AI Foundry account.

0 commit comments

Comments
 (0)