Unable to Delete Azure Virtual Network

Jorge Insfran 20 Reputation points
2023-12-15T15:51:26.79+00:00

I am attempting to delete an Azure virtual network but keep receiving the error message: "Failed to delete virtual network ''. Error: Subnet iat-5e5de8a6ba-dbsubnet is in use by /subscriptions/3909176c-e606-45ca-8108-c42fe9ad91b9/resourceGroups/wpiat/providers/Microsoft.Network/virtualNetworks/iat-f161f5eb1f-vnet/subnets/iat-5e5de8a6ba-dbsubnet/serviceAssociationLinks/9c84fe44-be2e-44e8-cd11-513b100ede35-sal and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet." I have deleted all the resources within the subnet, but the virtual network still can't be deleted. I have attempted several workarounds with no success. There is a delegation to Microsoft.DBforMySQL/flexibleServers in the subnet iat-5e5de8a6ba-dbsubnet that I can't delete or modify. Is there any way to get free one-time technical support to help resolve this issue?

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,497 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
843 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 111.1K Reputation points MVP
    2023-12-15T19:21:36.88+00:00

    Hi @Jorge Insfran ,

    let's see if we can get some attention to this thread:

    @GitaraniSharma-MSFT , @deherman-MSFT any idea how to help or get this issue solved?

    It sounds like a known issue since 2020 -> Unable to delete VNet due to serviceAssociationLinks/AppServiceLink. There is a marked answer in this thread from @suvasara-MSFT where he offers a free support ticket to resolve the issue if the workaround doesn't help.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    2 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 26,216 Reputation points Microsoft Employee
    2023-12-15T19:57:58.7466667+00:00

    @Jorge Insfran

    Thank you for reaching out.

    Thank you, Andreas Baumgarten for the detailed discussion above.

    Yes, as the deletion blocked in the backend a support request will be required here to remove the subnet delegation and to delete the Virtual Network.

    Could you please send an email to azcommunity@microsoft.com with the details below so that I can enable a one-time free support ticket for you in this case.

    Subject : Attn Chaitanya

    Thread URL: Link to this thread.

    Subscription ID

    Please let me know once you have done the same.

    Hope this helps! Please let me know if you have any additional questions. Thank you! 

    2 people found this answer helpful.

  2. Andreas Baumgarten 111.1K Reputation points MVP
    2023-12-15T16:25:48.6033333+00:00

    Hi @Jorge Insfran ,

    you can delete the delegation by yourself. After the successful removal you should be able to delete the subnet/vNet.

    Navigate to the rekated vNet and Subnet in the Azure Portal.

    Open the details of the subnet. It should look similar to this:

    subnet1

    Change the Delegate subnet to a service setting to None and click on Save

    enter image description here

    After saving ended successful try to delete the subnet/vNet again.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


  3. Andreas Baumgarten 111.1K Reputation points MVP
    2023-12-15T18:31:39.99+00:00

    Hi @Jorge Insfran ,

    related to the error message

    Failed to save subnet 'iat-5e5de8a6ba-dbsubnet'. Error: 'Subnet iat-f161f5eb1f-vnet/iat-5e5de8a6ba-dbsubnet requires any of the following delegation(s) [Microsoft.DBforMySQL/flexibleServers] to reference service association link /subscriptions/3909176c-e606-45ca-8108-c42fe9ad91b9/resourceGroups/wpiat/providers/Microsoft.Network/virtualNetworks/iat-f161f5eb1f-vnet/subnets/iat-5e5de8a6ba-dbsubnet/serviceAssociationLinks/9c84fe44-be2e-44e8-cd11-513b100ede35-sal.' there are some hints/workarounds. Maybe this helps:

    Cannot Remove Subnet Because of App Service VNet Integration

    Error deleting subnet serviceAssociationLinks AppServiceLink

    If it doesn't work with the workarounds I am afraid the only way is to get in contact with Azure Support.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.