Azure - Cannot delete a subnet, it's being used by ServiceAssociationLinks

BilalAlTarazy-2894 1 Reputation point
2023-10-17T08:14:48.76+00:00

Hello, I need assistance with an issue related to Azure. Previously, I conducted a Proof of Concept (PoC) wherein I accessed Azure Database for MySQL and deployed Wordpress + MySQL Flexible server After concluding the PoC, I attempted to delete the resource group.

While it seemed as though every component was deleted successfully, a residual subnet remained due to a SUBNET DELEGATION to Microsoft.DBforMySQL/flexibleServers. When I tried disabling the delegation by selecting 'None', I encountered an error:

Failed to save subnet 'yourdress-8a00548b7c-dbsubnet'. Error: 'Subnet yourdress-c9320e920f-vnet/yourdress-8a00548b7c-dbsubnet requires any of the following delegation(s) [Microsoft.DBforMySQL/flexibleServers] to reference service association link /subscriptions/fcc569ab-e240-4361-bdef-ca17f09985c0/resourceGroups/wordpress/providers/Microsoft.Network/virtualNetworks/yourdress-c9320e920f-vnet/subnets/yourdress-8a00548b7c-dbsubnet/serviceAssociationLinks/748d6126-6818-f55d-ff3c-3442bf6f374b-sal.'

Similarly, an error appeared when I attempted to delete the subnet directly:

Failed to delete subnet 'yourdress-8a00548b7c-dbsubnet'. Error: Subnet yourdress-8a00548b7c-dbsubnet is in use by yourdress-c9320e920f-vnet/yourdress-8a00548b7c-dbsubnet/748d6126-6818-f55d-ff3c-3442bf6f374b-sal and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.

Upon closer inspection, it seems there is a serviceAssociationLink attached to the subnet delegation, preventing its disablement or deletion. Moreover, despite not having the MySQL resource visibly available, my cost management indicates that expenses are still being incurred due to Azure Database for MySQL. The resource does not appear to be hidden within the resource group either.

I read many articles and I tried Azure Resource Explorer but none worked for me

Could you please guide me on resolving this issue and successfully deleting the subnet?

Your help would be immensely appreciated.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,311 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
771 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 49,401 Reputation points Microsoft Employee
    2023-11-03T09:48:26.4266667+00:00

    Hello @BilalAlTarazy-2894 ,

    I understand that you were unable to delete a subnet and receiving the following error: Failed to delete subnet 'yourdress-8a00548b7c-dbsubnet'. Error: Subnet yourdress-8a00548b7c-dbsubnet is in use by yourdress-c9320e920f-vnet/yourdress-8a00548b7c-dbsubnet/748d6126-6818-f55d-ff3c-3442bf6f374b-sal and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.

    Since you already tried the possible workarounds and the issue persisted, the orphaned Service Association Link needed to be cleaned from the backend. So, informed you that we may need to raise a support ticket to get the Service Association Link (SAL) deleted from the backend. Also offered you a one-time free support in case you don't have a support plan.

    You mentioned that you would like help in getting a one-time free support, as you don't have a support plan.

    So, we enabled a one-time free support ticket for your issue and the support team investigated the issue from their end.

    The support team then engaged the concerned team, and they removed the orphaned Service Association Link from the backend of your subscription and now you were able to delete the subnet.

    Kindly let us know if you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments