Hi Chi Sang Hui,
This issue occurs when an Azure Kubernetes Service (AKS) cluster is deleted, but the associated Azure Load Balancer ("kubernetes") and backend pools remain in the resource group. This is often due to orphaned network interfaces (NICs) or lingering dependencies.
Steps to resolve:
Check and delete orphaned NICs
The load balancer might still be associated with orphaned NICs from the deleted Virtual Machine Scale Set (VMSS). Run the following command to list NICs in the resource group:
az network nic list --resource-group <RESOURCE_GROUP_NAME> --query "[].id" -o tsv
If any NICs exist, delete them:
az network nic delete --ids <NIC_ID>
Remove backend pools manually
If the backend pools are still associated with deleted VMSS instances, remove them manually:
az network lb address-pool list --resource-group <RESOURCE_GROUP_NAME> --lb-name kubernetes
If any backend pools exist, delete them:
az network lb address-pool delete --resource-group <RESOURCE_GROUP_NAME> --lb-name kubernetes --name <POOL_NAME>
Delete the load balancer Once dependencies are removed, delete the load balancer:
az network lb delete --resource-group <RESOURCE_GROUP_NAME> --name kubernetes
Check for other dependencies
Verify if any public IPs, managed identities, or NSGs related to the AKS cluster remain in the resource group and delete them.
If it was helpful, please click "Upvote" on this post to let us know.
Thank You.