Can't remove Azure Lab Services-related resources

Irvin.Lee 0 Reputation points
2023-09-27T08:58:50.1866667+00:00

A few days ago, I created a Lab plan and delete it, but still "Load balancer" remain in my "Resource group" and can not be deleted, any one can help me to delete the vmss-template?

Thank you!

Error details

lb-V1ES-338502: Cannot delete load balancer /subscriptions/31273087-80b1-465b-8799-255a1f18f9ea/resourceGroups/Digi_Cosmos_LabService/providers/Microsoft.Network/loadBalancers/lb-V1ES-338502 since its child resources /subscriptions/31273087-80b1-465b-8799-255a1f18f9ea/resourceGroups/Digi_Cosmos_LabService/providers/Microsoft.Network/loadBalancers/lb-V1ES-338502/inboundNatPools/natPoolTemplate3389,bepool are in use by virtual machine scale set /subscriptions/11976a37-27ee-4b28-8725-b28e9aeff4e9/resourceGroups/rg-6130168d-0cc8-40f7-b34f-08bb6c1801f8/providers/Microsoft.Compute/virtualMachineScaleSets/vmss-template. (Code: LoadBalancerInUseByVirtualMachineScaleSet)

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
279 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. v-vvellanki-MSFT 3,735 Reputation points Microsoft Vendor
    2023-09-28T06:00:15.6366667+00:00

    Hi @Irvin.Lee ,

    Thanks for contacting Microsoft Q&A.
    The error message you've received indicates that you cannot delete the Load Balancer because it is still in use by a Virtual Machine Scale Set (VMSS). This is expected behavior, as Azure prevents the deletion of resources that are actively being used by other resources to avoid disrupting active workloads. To delete the Load Balancer, you'll first need to disassociate it from the VMSS. Here's how you can proceed:

    To disassociate the Load Balancer from the VMSS, follow these steps:

    ·       Go to the Azure portal.

    ·       Navigate to the Load Balancer resource (lb-V1ES-338502) in your Resource Group.

    ·       Look for the "Backend pools" section and select the backend pool associated with the VMSS (bepool).

    ·       In the backend pool configuration, remove the association with the VMSS. This effectively disassociates the Load Balancer from the VMSS.

    ·       Save your changes.

    Delete the Load Balancer: After disassociating the Load Balancer from the VMSS, you should be able to delete the Load Balancer without encountering the "LoadBalancerInUseByVirtualMachineScaleSet" error:

    ·       Go back to the Load Balancer resource in the Azure portal.

    ·       Click on the Load Balancer and look for the "Delete" button in the top menu.

    ·       Click it to initiate the deletion process.

    ·       Follow the on-screen prompts to confirm and delete the Load Balancer.


  2. Pedro Lopez 0 Reputation points
    2024-02-06T15:03:18.8266667+00:00

    Hi. Same issue here. Recently we made some tests with azure labs and after deleting all the resources, we have a load balancer that can't be removed because a vmss pertaining to another subscription is using it. We can't disassociate this vmss because we don't have access to it. Is there any workaround for this? thanks

    0 comments No comments