I can't desativate my Azure account because of VNet

Christian cauã 20 Reputation points
2023-07-10T11:25:28.8666667+00:00

I can't desativate my Azure account because of VNet associated with an inexistent web site. I was trying to remove all system of my site's deployment, but the subnet wasn't desconnected before the service application was deleted. Now, even trying to create the application web with the same name and desconnecting, this isn't working.

Error:

Failed to delete subnet 'mind-errorAppSubnet'. Error: The mind-errorAppSubnet subnet is being used by mind-error/providers/Microsoft.Network/virtualNetworks/mind-errorVnet/subnets/mind-errorAppSubnet/serviceAssociationLinks/AppServiceLink'>mind-errorVnet/mind-errorAppSubnet/AppServiceLink and cannot be deleted. To delete the subnet, delete all resources within it. Check out aka.ms/deletesubnet.

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,632 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,280 questions
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 49,806 Reputation points Microsoft Employee
    2023-07-18T15:07:58.0033333+00:00

    Hello @Christian cauã ,

    I understand that you were unable to delete a Vnet and received the following error: 'Failed to delete subnet 'mind-errorAppSubnet'. Error: The mind-errorAppSubnet subnet is being used by mind-error/providers/Microsoft.Network/virtualNetworks/mind-errorVnet/subnets/mind-errorAppSubnet/serviceAssociationLinks/AppServiceLink'>mind-errorVnet/mind-errorAppSubnet/AppServiceLink and cannot be deleted. To delete the subnet, delete all resources within it.'

    You already confirmed that you had a Vnet integration between the mind-errorAppSubnet subnet and a Web App and it was not disconnected properly before deletion.

    The above error occurs because when you have VNet Integration between a subnet and a Web App (part of App Service Plan), in the backend there is link automatically created (AppServiceLink) and a default delegation on the specified subnet Microsoft.Web/serverFarm and if you delete the Web App/App Service Plan or set subnet delegation to none without disconnecting the VNet integration first, the link gets stuck in the backend and the delegation also, therefore it cannot be removed.

    We have a workaround which can be tried to resolve this issue (may or may not work, depending on the situation):

    If you have already deleted the Web App, follow steps 1 to 5. If the Web App hasn't been deleted yet, follow steps 3 to 5.

    1. Recreate the App Service Plan that you had (the one you used for VNet Integration) with the exact same name as before in the exact same region as the vnet.
    2. Recreate the Web App (name of web app does not matter, it is important only for the ASP)
    3. Recreate the VNet Integration from Web App > Networking Blade > New VNet Integration and select the specific subnet
    4. Properly remove the VNet Integration by hitting “Disconnect” in the Web App > Networking > VNet Integration.
    5. Now try and delete the subnet/vnet or set the Subnet Delegation to "none".

    Since you already confirmed that you tried the above steps and it did not help in fixing your issue, we filed a support ticket to engage the backend team for help. The support team confirmed that the orphaned SAL (ServiceAssociationLink) has been deleted from the backend. You also validated the same and were able to delete the Vnet successfully.

    Kindly let us know if the above helps or 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

0 additional answers

Sort by: Most helpful

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.