If your Azure Container App is stuck in the "Status=Unknown" state during deletion, you may need to manually delete the associated Virtual Network (VNet) that is being used by the Azure Container Apps environment. Here are the steps you can follow:
- Identify the VNet being used by the environment you're trying to delete. You can do this by running the following command in Azure CLI, replacing
<RESOURCE_GROUP>and<ENVIRONMENT>with your actual resource group and environment names:
Look for theaz containerapp env show --resource-group <RESOURCE_GROUP> --name <ENVIRONMENT>infrastructureSubnetIdin the output to find the VNet ID. - Once you have the VNet ID, delete the VNet manually using the following command:
az network vnet delete --resource-group <RESOURCE_GROUP> --name <VNET_ID> - After deleting the VNet, you can attempt to delete the Azure Container Apps environment again with:
az containerapp env delete --resource-group <RESOURCE_GROUP> --name <ENVIRONMENT> --yes
This should help resolve the issue and allow you to delete the container app successfully.