skip to Main Content

I recently created inside one of my resource groups an Azure Container App (with an environment & the rest) just for learning reasons (at the West Europe region). After I played with that, I decided to delete it. I tried to delete it without any success from the portal.

Looking around in the portal I found out that a new resource group had been created with name MC_braverock-518cbd83-rg_braverock-518cbd83_westeurope. This resource group was never generated by me. It appears that inside it there are a public IP address, a NSG & 2 Kubernetes Load Balancers.

I tried then to delete that auto-generated (somehow) resource group but again with no success. I literarily can’t even touch it. I tried to delete all resources one by one. Nothing again. I even issued the command az group delete --resource-group "MC_braverock-518cbd83-rg_braverock-518cbd83_westeurope" from inside the Azure Cloud Shell and it seems that the cli gets stuck in Running…. When I had issued the command from the portal it was still running for a whole hour. So, obviously something is going wrong.

I visited the page https://resources.azure.com/, then I visited that resource group and the Json in the resource group that returned is having the following:
"provisioningState": "Deleting".

Do you know how I can delete the resources & the resource group?

I am almost confident that this is not being deleted… 🙁

EDIT:
Trying to delete manually one of the Load Balancers in that resource group I get a message that the Load Balancer in that subscription can not be deleted as it is in use by a virtual machine scale set that it is on a totally different subscription (a subscription that I am not aware off).

enter image description here

3

Answers


  1. To delete the resources and the resource group, you can try using Resource Explorer (azure.com) portal as there might be some dependencies to delete the resource group/resources.

    You can try deleting the resources like below:

    enter image description here

    • Expand Providers -> Microsoft.Network -> networkSecurityGroups -> Select your NSG -> Action(POST,DELETE) -> Delete

    enter image description here

    In my environment testnsg networkSecurityGroup deleted successfully in the Azure Portal.

    • You can try deleting the required Azure Resources by following the same process. If still, you are not able to delete the Azure resource Group try checking the child resources associated to that resource group.

    I tried to reproduce the same in my environment and got the same error like below:

    az network lb delete -g ResourceGroupName  -n LoadBalancerName
    

    enter image description here

    The error "LoadBalancerUseByVirtualMachineScaleSet" usually occurs if backendpool is being used by any other resource.

    To resolve the error, try executing below commands in CloudShell like below:

    • Delete the load balancer associated with the VMSS:
    az vmss update --resource-group ResourceGroupName1 --name VmssName --remove virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].loadBalancerBackendAddressPools 0
    

    enter image description here

    • Update the VMSS instance:
    az vmss update-instances --instance-ids "*" -n VmssName -g ResourceGroupName1
    

    enter image description here

    Now, delete load balancer and it will be deleted successfully like below:

    az network lb delete -g ResourceGroupName -n LoadBalancerName
    

    enter image description here

    Reference:

    Update or delete an existing load balancer used by virtual machine scale sets – Azure Load Balancer

    Login or Signup to reply.
  2. This is a side artifact of Container app managedEnvironment resource. You need to first delete the environment in order to get artifacts to get automatically removed.

    Login or Signup to reply.
  3. As JJ mentioned, the MC_* resource group is created when you create ACAs with the internal configuration. You try to find whether you have any container app environments in your subscription. Could be that you created your test app in a wrong resource group and can’t find it now. 🙂

    Try deleting all container app envs this resource group will automatically be gone.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search