Loadbalancer fails to delete

Jeroen van Hoof 5 Reputation points
2025-02-12T10:18:35.5666667+00:00

Hi,

I am trying to delete a loadbalancer that remains from an Azure Lab long since deleted. It fails as the bepool seems to be connected to a VMSS that no longer exists.

I am stuck in circles.

Every delete or disassociation fails because either does not exist, or is connected to a non-existant subscription ID.

But I am being charged for this loadbalancer every day. Also the connected IP, which also will not delete as it is connected to the LB and cannot be disassociated.

Thanks for any help.

Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
483 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Maksym Perehinets 25 Reputation points
    2025-02-12T10:36:37.2633333+00:00

    Hi Jeroen van Hoof

    Please follow these steps, using the Azure CLI for precise control:

    1. Resource Inventory: We need a comprehensive view of resources associated with the load balancer. Execute the following commands, replacing placeholders with your specific resource group and load balancer names:
         az network nic list --query "[]" --output table  # Identify network interfaces
         az network lb probe list -g <RESOURCE_GROUP_NAME> --lb-name <LB_NAME>  # Examine health probes
         az network lb show -g <RESOURCE_GROUP_NAME> -n <LB_NAME>  # Retrieve detailed load balancer properties
      
    2. Dependency Resolution: Based on the output from the previous commands, address any remaining dependencies. This often involves removing associations with backend pools, rules, or other resources. Use the following commands as needed, replacing placeholders with actual names and addresses:
         az network lb backend-pool remove --resource-group <RESOURCE_GROUP_NAME> --lb-name <LB_NAME> --name <BACKEND_POOL_NAME> --backend-addresses <ADDRESS>  # Dissociate backend pool members
         az network lb rule delete --resource-group <RESOURCE_GROUP_NAME> --lb-name <LB_NAME> --name <RULE_NAME>  # Remove load balancing rules
      
    3. Load Balancer Deletion: After addressing all dependencies, attempt to delete the load balancer:
         az network lb delete --resource-group <RESOURCE_GROUP_NAME> --name <LB_NAME>
      

    Azure Support:

    If the load balancer persists after completing these steps, please escalate this issue to Azure Support. They possess advanced diagnostic tools and access to backend systems that can help pinpoint the problem. When contacting support, please provide the following information to expedite the resolution process:

    • Detailed problem description, including the steps you've already taken.
    • Resource IDs of the load balancer and any related resources.
    • Output from the Azure CLI commands listed above, especially the az network lb show command.
    • Any relevant screenshots from the Azure portal.

    You can contact Azure Support through the Azure portal.

    If this was helpful, please accept the answer.


  2. Ganesh Patapati 3,765 Reputation points Microsoft Vendor
    2025-02-12T16:11:29.8833333+00:00

    Hello Jeroen van Hoof

    Greetings!

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
    Based on the error details you shared; I have shared troubleshooting steps that I felt will help resolve the issue you reported.

    If the Load Balancer resource is in use by a Virtual Machine Scale Set and can't be deleted. Use the Azure Resource Manager ID provided in the error message to search for the Virtual Machine Scale Set in order to delete it.

    Check if there are any remaining resources linked to the load balancer that might prevent its deletion:

    List Network Interfaces: az network nic list --query "[].{Name:name, IPConfigs:ipConfigurations[].{Name:name, LBBackendPools:loadBalancerBackendAddressPools[].id}}"

    Check Load Balancer Health Probes: az network lb probe list -g <<RESOURCE_GROUP_NAME>> --lb-name <<LB_NAME>>

    Check the Load Balancer details: az network lb show -g <<RESOURCE_GROUP_NAME>> -n <<LB_NAME>>

    If you find any dependencies, remove them manually by using the following commands:

    For Backend Address Pool: az network lb backend-pool remove --resource-group <<RESOURCE_GROUP_NAME>> --lb-name <<LB_NAME>> --name <<BACKEND_POOL_NAME>> --backend-addresses <ADDRESS>

    To remove Load Balancer Rules: az network lb rule delete --resource-group <<RESOURCE_GROUP_NAME>> --lb-name <<LB_NAME>> --name <<RULE_NAME>>

    You can also check the dependencies using the Azure Resource Explorer: Go to the Azure Resource Explorer. then Navigate to the load balancer resource and check the JSON properties for any references to the VMSS or other resources that may still exist. If you find any stale references, you can delete them directly from Resource Explorer.


    Please let us know if you have any further queries. I’m happy to assist you further.

    0 comments No comments

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.