Unable to delete a load balancer in Azure

broderick roelf 0 Reputation points
2025-03-29T18:30:29.3933333+00:00

I'm trying to delete a load balancer in my subscription, but I get an error message which says it has child resource which are in use by a virtual machine scale set in ANOTHER subscription.

Needless to say, I can't delete child resources, nor dissociate it from the vmss.

Remove-AzLoadBalancer: Cannot delete load balancer /subscriptions/661a6a8f-3dd8-4759-85d5-5a1cbd1fd4bf/resourceGroups/mc_victoriousdune-68387d6f-rg_victoriousdune-68387d6f_northeurope/providers/Microsoft.Network/loadBalancers/kubernetes since its child resources aksOutboundBackendPool,kubernetes are in use by virtual machine scale set /subscriptions/34b54468-a5ba-416a-a864-ed08540bd353/resourceGroups/MC_victoriousdune-68387d6f-rg_victoriousdune-68387d6f_northeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-userpool1-71415784-vmss.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,690 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Abiola Akinbade 26,900 Reputation points
    2025-03-30T15:38:29.68+00:00

    You’re trying to delete a Load Balancer in one subscription, but it’s still referenced by a VMSS that lives in a different subscription. You must remove the backend pool reference from the VMSS first

    See this answer here that describes how to do this: https://learn.microsoft.com/en-us/answers/questions/1376972/cant-remove-azure-lab-services-related-resources

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    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.