Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Cleanup

If you’re not going to continue to use this lab environment, run the following command to delete the resource group along with all the resources created in this lab.

There is a known issue when delete OpenAI instance, Azd down on OpenAI instance, extra steps required to delete all the resources.

Delete environment created by Azd automation

  1. Prepare

    • Set config flag for OpenAI instance

      azd config set alpha.deployment.stacks on

  2. Tear down the azd environment

    • run azd env list to see all the environments
    • run azd down -e <env-name> --force --purge to clean up the target environment

Delete environment created by manual steps

  1. Clean up the Azure Cognitive Services account

    • list the deployments

      az cognitiveservices account deployment list -g $RESOURCE_GROUP -n $OPEN_AI_SERVICE_NAME -o table

    • delete the deployments on by one

      az cognitiveservices account deployment delete -g $RESOURCE_GROUP -n $OPEN_AI_SERVICE_NAME --deployment-name <deployment-name>

    • delete the Azure Cognitive Services account

      az cognitiveservices account delete -g $RESOURCE_GROUP -n $OPEN_AI_SERVICE_NAME

  2. Delete the resource group with all the resources

    az group delete --name $RESOURCE_GROUP

It takes about 30 minutes to delete all the resources in the environment.