Hi.
I did some provision testing for AI resources bicep and want to delete resources. I tried to delete the VNet and got this error.
Failed to delete virtual network 'agent-vnet-test'. Error: Subnet agent-subnet is in use by /subscriptions/xxxxx-xxxxx/resourceGroups/ai-private-infra-02/providers/Microsoft.Network/virtualNetworks/agent-vnet-test/subnets/agent-subnet/serviceAssociationLinks/legionservicelink and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.
Then, I tried to delete the subnet and remove delegation but also has this error.
Failed to delete subnet 'agent-subnet'. Error: Subnet agent-subnet is in use by /subscriptions/xxxxx-xxxxx/resourceGroups/ai-private-infra-02/providers/Microsoft.Network/virtualNetworks/agent-vnet-test/subnets/agent-subnet/serviceAssociationLinks/legionservicelink and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.
Failed to save subnet 'agent-subnet'. Error: 'Subnet /subscriptions/xxxxx-xxxxx/resourceGroups/ai-private-infra-02/providers/Microsoft.Network/virtualNetworks/agent-vnet-test/subnets/agent-subnet requires any of the following delegation(s) [Microsoft.App/environments] to reference service association link /subscriptions/xxxxx-xxxxx/resourceGroups/ai-private-infra-02/providers/Microsoft.Network/virtualNetworks/agent-vnet-test/subnets/agent-subnet/serviceAssociationLinks/legionservicelink. Those delegations are either missing or getting deleted from subnet.'
Please suggest me how to delete these resources.
Bests,
Kong