Unable to remove subnet due to AppServiceLink Error

Anthony B 0 Reputation points
2024-11-12T19:31:31.3766667+00:00

Hello everybody,

I would like to remove all my ressources because I stop my activity but I can't remove the last subnet due to an AppServiceLink error as you can see below (sorry, in french):

User's image

Can you help me please ? :)

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,019 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 1,155 Reputation points Microsoft Vendor
    2024-11-13T07:11:31.4133333+00:00

    Hi @Anthony B ,

    welcome to the Microsoft Q&A Platform!
    Remove App Service Link Association:

    • Go to Virtual Network > Subnets in the Azure portal.
    • Locate the subnet, check for Service Association Links, and remove any links.

    Delete Dependent Resources:

    • Ensure no resources (e.g., App Services, VMs, SQL databases) are using the subnet.
    • Delete any remaining associated resources.

    Retry Deletion:

    • Once dependencies are cleared, attempt to delete the subnet

    Use Azure CLI for Forced Disassociation (if needed):

    az network vnet subnet update \
      --resource-group <ResourceGroupName> \
      --vnet-name <VNetName> \
      --name <SubnetName> \
      --remove serviceAssociationLinks
    
    • refer to Delete a Subnet in Azure.
      If the answer is helpful, please click "Accept Answer" and kindly upvote it.

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.