An Azure service that provides a general-purpose, serverless container platform.
Hello Kelby,
Thank you for reaching out to the Microsoft Q&A platform.
I understand you are experiencing an issue where your Azure Container Apps Managed Environment is stuck in the ScheduledForDelete state for multiple days, leaving your subnet blocked by lingering network associations. I also noted your comment that you do not want to delete the Virtual Network because it must be used by another Container Apps Environment.
This behavior occurs because the Azure Container Apps resource provider encountered a timeout or control-plane failure during the background de-provisioning process. As a result, the backend resources are orphaned, and the Service Association Link (SAL) remains on your subnet.
According to the official Azure Virtual Network troubleshooting documentation:
"You can't delete or modify a subnet if it has resources connected to it. These resources include... service association links... If a subnet is delegated to a service, you must first remove the delegation."
However, because Container Apps is a managed service, the Service Association Links (Microsoft.App/environments) are locked by the Resource Provider. Attempting to manually delete the SAL or remove the delegation via CLI/Portal will result in an authorization or resource lock error.
To confirm above, run the following Azure CLI command to query the service association links on your subnet:
az network vnet subnet show \
--resource-group <Your-Resource-Group> \
--vnet-name <Your-VNet-Name> \
--name <Your-Subnet-Name> \
--query "serviceAssociationLinks[].{Name:name, Type:linkedResourceType, ProvisioningState:provisioningState}" \
--output table
Interpreting the Results: If the output displays a record with the Type Microsoft.App/environments, this confirms that the Container Apps resource provider still holds an active lock on your subnet, despite your environment being stuck in the ScheduledForDelete state.
How to resolve this:
Since the environment is permanently stuck in ScheduledForDelete, this requires aforce-cleanup by backend Team via Support request. We cannot manually force the deletion from the user side once the resource provider lock is in this hung state.
In Private message, please share the following details so the internal engineering team can forcefully purge the orphaned locks:
- Subscription ID
- Resource Group Name
- Stuck Managed Environment Name
- Virtual Network and Subnet Name
- Approximate time the deletion was initially requested
- Subnet URI
Workaround to unblock your deployment: Since you need to use the existing VNet for a new Container Apps Environment, you do not need to wait for support to deploy your new workloads. You can create a new subnet within the same VNet, delegate it to Microsoft.App/environments, and deploy your new Container App Environment there while Microsoft Support cleans up the blocked subnet.
Hope this helps!