An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
Hi @Tekscape_Bryan Mohr ,
Thank you for reaching out to Microsoft Q&A Platform.
My understanding of Problem is:
You cannot delete a subnet in an Azure Virtual Network because it is associated with a service through a Service Association Link (SAL). The Azure Portal may not always show the SAL under the subnet blade.
Please perform the below steps and let me know if it helps.
Possible Root Causes
- Private Endpoint associated with the subnet.
- Subnet Delegation to a specific Azure service.
- Other resources (e.g., Azure Firewall, Application Gateway) using the subnet.
Step-by-Step Resolution
- Identify Service Association Links via CLI
Run the following command:
az network vnet subnet show \
--resource-group <ResourceGroupName> \
--vnet-name <VNetName> \
--name <SubnetName> \
--query serviceAssociationLinks
If the output is not empty, note the associated resource.
- Check for Private Endpoints
List all Private Endpoints in the VNet:
az network private-endpoint list \
--resource-group <ResourceGroupName> \
--query "[?contains(subnet.id, '<SubnetName>')]"
Delete any Private Endpoint using the subnet:
az network private-endpoint delete \
--name <PrivateEndpointName> \
--resource-group <ResourceGroupName>
- Check for Subnet Delegation
If the subnet is delegated to a service, remove the delegation:
az network vnet subnet update \
--resource-group <ResourceGroupName> \
--vnet-name <VNetName> \
--name <SubnetName> \
--remove delegations
- Verify No Other Dependencies
Ensure no NICs, route tables, or service endpoints are linked:
az network vnet subnet show \
--resource-group <ResourceGroupName> \
--vnet-name <VNetName> \
--name <SubnetName>
- Delete the Subnet
Once all associations are removed:
az network vnet subnet delete \
--resource-group <ResourceGroupName> \
--vnet-name <VNetName> \
--name <SubnetName>