Can't delete resource group even I try solutions on internet.

Papatsiri Apipaiboon 0 Reputation points
2023-02-06T18:29:00.43+00:00

Hi, I can’t delete my resource group and it keep deduct my money from student ambassadors subscription. I try all solution that I found on internet like force delete through Azure PowerShell, try delete Vnet and subnet, try to delete on another browser and try more solutions, but nothings work.

The error:

Failed to delete resource group event101: Deletion of resource group 'event101' did not finish within the allowed time as resources with identifiers 'Microsoft.Network/virtualNetworks/myportfoli-e03850739a-vnet' could not be deleted. The provisioning state of the resource group will be rolled back. The tracking Id is '26ac5ab8-3d6e-4fb7-a020-c427c245c330'. Please check audit logs for more details. (Code: ResourceGroupDeletionTimeout) Subnet myportfoli-e03850739a-appsubnet is in use by /subscriptions/56814df6-a570-42c0-abc4-21cecba15d7d/resourceGroups/event101/providers/Microsoft.Network/virtualNetworks/myportfoli-e03850739a-vnet/subnets/myportfoli-e03850739a-appsubnet/serviceAssociationLinks/AppServiceLink and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See [aka.ms/deletesubnet]. (Code: InUseSubnetCannotBeDeleted, Target: /subscriptions/56814df6-a570-42c0-abc4-21cecba15d7d/resourceGroups/event101/providers/Microsoft.Network/virtualNetworks/myportfoli-e03850739a-vnet)

when I try to delete virtual network :

Failed to delete virtual network 'portfolio2-ba77fb7a06-vnet'. Error: Subnet portfolio2-ba77fb7a06-appsubnet is in use by /subscriptions/56814df6-a570-42c0-abc4-21cecba15d7d/resourceGroups/test101/providers/Microsoft.Network/virtualNetworks/portfolio2-ba77fb7a06-vnet/subnets/portfolio2-ba77fb7a06-appsubnet/serviceAssociationLinks/AppServiceLink and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See [aka.ms/deletesubnet].

 

Hope Someone can help me ASAP, Thanks

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
928 questions
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,139 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Dillon Silzer 54,466 Reputation points
    2023-02-06T18:35:05.8566667+00:00

    Hello,

    #1 From a similar post found here:

    Workaround:

    1. Create App Service Plan with the same name as the deleted one
    2. Create App Service with the same name as the deleted one
    3. Link App Service with the VNET subnet
    4. Disconnect VNet from App Service -> Networking -> VNet integration -> Disconnect
    5. Delete subnet

    Reason for this Error:
    The new VNET integration feature (Regional Vnet Integration) must set locks on subnets in the Network Resource Provider, we set these locks by putting a structure called a Service Association Link onto the Subnet, which is a privileged operation that only Microsoft.Web and some other internal Azure services have access to, this ends up being odd cases where these locks don't get cleaned up. The result is that the customer will have a subnet that cannot be deleted or used because a Service Association Link still exists on the subnet.
    Azure App Service and Azure Networking Product Group keep working on to fix the issue completely.

    #2 Submit this issue to Azure Support:

    https://azure.microsoft.com/en-us/support/create-ticket


    If this is helpful please accept answer.

    2 people found this answer helpful.
    0 comments No comments

  2. ChaitanyaNaykodi-MSFT 22,776 Reputation points Microsoft Employee
    2023-02-06T19:06:31.0166667+00:00

    @Papatsiri Apipaiboon ,

    Thank you for reaching out on the Microsoft Q&A forum. If I understand it correctly you are trying to delete a Resource Group in Azure where you had deployed an Azure App Service and integrated with a Virtual Network.

    You can try the below steps and see if it helps in deleting the Resource Group.

    • If the Azure App Service is still present in the resource group.
    1. On Azure portal you can go to the Web app > Networking > VNet integration
    2. Select Disconnect to disconnect your app from a virtual network and then you can Delete the resource group.
    • If the App Service is already deleted and you are getting the error while trying to delete the Azure Virtual Network.
    1. In this case, you can follow the solution discussed here, you will have to recreate the deleted App Service and link it back to the Virtual Network and then delete it again.
    2. As discussed in the solution I shared above. If you have forgotten the app service name, you can use Get-AzDeletedWebApp (Az.Websites) | Microsoft Learn to retrieve the app name. For getting the details of the app service plan, you can go to Resource explorer from your portal. After going, you can go to the subnet details and you can get the details of previous app service plan in which previous integrated web app was hosted.

    I hope this helps. Please let me know if this solution did not work, we will gladly help you further to get rid of this issue. Thank you!


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


  3. Ítalo Reis 0 Reputation points
    2023-12-16T17:18:59.75+00:00

    I was having the same problem. For me, due to a dependencie i couldn't delete my resource group. I've needed to delete the Azure Backup Recovery Service vault with a shell script and disabling soft deleting as explained in this website from microsoft : https://learn.microsoft.com/en-us/azure/backup/backup-azure-delete-vault?tabs=portal. After it, i finally made it to delete the resource group.

    0 comments No comments