impossible to delete resource group

Anonymous
2021-11-02T10:48:43.34+00:00

I want to delete my resource group linux. But never success, it just hang there and never stop

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

8 answers

Sort by: Most helpful
  1. Pradeep Kommaraju 2,546 Reputation points
    2021-11-02T16:31:15.937+00:00

    Hi @Anonymous

    Thank you for reaching out to Microsoft Q&A Platform .

    Just wanted to check if you are facing the same issue while trying to delete the RG using CLI as well : https://learn.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest#az_group_delete-examples

    az group delete -n MyResourceGroup

    The above command will go through a different API to the backend .

    Also wanted to check if you have used any of the resources which are in use from other resource groups ?

    Please accept my answer if it does help in resolving your issue as well

    Thanks & Regards,
    Pradeep

    1 person found this answer helpful.
    0 comments No comments

  2. Vincent Chong 11 Reputation points
    2022-09-15T18:59:28.477+00:00

    Hi,
    i follow procedure in https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-cli

    and I am waiting on completion of below command, normally how long should it tae?

    az group delete --name myResourceGroup

    Thanks
    Vincent

    1 person found this answer helpful.

  3. Vincent Chong 11 Reputation points
    2022-09-19T17:33:06.717+00:00

    @George Chrysovalantis Grammatikos
    @Pradeep Kommaraju

    I tried the force delete option, but I do not think it is doing anything. The deletion is still not completed after 30 minutes, but I will give it more time.

    Do I need to shutdown the resources first? Do I need to specify force deletion other resources too?

       $ az vm list --resource-group MyResourceGroup --show-details  
       [  
         {  
           "additionalCapabilities": null,  
           "applicationProfile": null,  
           "availabilitySet": null,  
           "billingProfile": null,  
           "capacityReservation": null,  
           "diagnosticsProfile": null,  
           "evictionPolicy": null,  
           "extendedLocation": null,  
           "extensionsTimeBudget": null,  
           "fqdns": "",  
           "hardwareProfile": {  
             "vmSize": "Standard_DS1_v2",  
             "vmSizeProperties": null  
           },  
           "host": null,  
           "hostGroup": null,  
           "id": "/subscriptions/<omitted_id>/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",  
           "identity": null,  
           "licenseType": null,  
           "location": "eastus",  
           "macAddresses": "00-22-48-21-FE-E2",  
           "name": "myVM",  
           "networkProfile": {  
             "networkApiVersion": null,  
             "networkInterfaceConfigurations": null,  
             "networkInterfaces": [  
               {  
                 "deleteOption": null,  
                 "id": "/subscriptions/<omitted_id>/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/myVMVMNic",  
                 "primary": null,  
                 "resourceGroup": "myResourceGroup"  
               }  
             ]  
           },  
           "osProfile": {  
             "adminPassword": null,  
             "adminUsername": "azureuser",  
             "allowExtensionOperations": true,  
             "computerName": "myVM",  
             "customData": null,  
             "linuxConfiguration": {  
               "disablePasswordAuthentication": true,  
               "enableVMAgentPlatformUpdates": false,  
               "patchSettings": {  
                 "assessmentMode": "ImageDefault",  
                 "automaticByPlatformSettings": null,  
                 "patchMode": "ImageDefault"  
               },  
               "provisionVmAgent": true,  
               "ssh": {  
                 "publicKeys": [  
                   {  
                     "keyData": "<omitted-ssh-rsa>",  
                     "path": "/home/azureuser/.ssh/authorized_keys"  
                   }  
                 ]  
               }  
             },  
             "requireGuestProvisionSignal": true,  
             "secrets": [],  
             "windowsConfiguration": null  
           },  
           "plan": null,  
           "platformFaultDomain": null,  
           "powerState": "VM running",  
           "priority": null,  
           "privateIps": "10.0.0.4",  
           "provisioningState": "Succeeded",  
           "proximityPlacementGroup": null,  
           "publicIps": "<omitted-public-ip>",  
           "resourceGroup": "MyResourceGroup",  
           "resources": null,  
           "scheduledEventsProfile": null,  
           "securityProfile": null,  
           "storageProfile": {  
             "dataDisks": [],  
             "imageReference": {  
               "communityGalleryImageId": null,  
               "exactVersion": "0.20220911.1135",  
               "id": null,  
               "offer": "debian-10",  
               "publisher": "Debian",  
               "sharedGalleryImageId": null,  
               "sku": "10",  
               "version": "latest"  
             },  
             "osDisk": {  
               "caching": "ReadWrite",  
               "createOption": "FromImage",  
               "deleteOption": "Detach",  
               "diffDiskSettings": null,  
               "diskSizeGb": 30,  
               "encryptionSettings": null,  
               "image": null,  
               "managedDisk": {  
                 "diskEncryptionSet": null,  
                 "id": "/subscriptions/<omitted_id>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/<omitted-myVM_disk1>",  
                 "resourceGroup": "myResourceGroup",  
                 "securityProfile": null,  
                 "storageAccountType": "Premium_LRS"  
               },  
               "name": "<omitted-myVM_disk1>",  
               "osType": "Linux",  
               "vhd": null,  
               "writeAcceleratorEnabled": null  
             }  
           },  
           "tags": {},  
           "timeCreated": "2022-09-15T17:07:10.911524+00:00",  
           "type": "Microsoft.Compute/virtualMachines",  
           "userData": null,  
           "virtualMachineScaleSet": null,  
           "vmId": "<omitted-vmId>",  
           "zones": null  
         }  
       ]  
         
       $ az group delete -n MyResourceGroup --force-deletion-types Microsoft.Compute/virtualMachines  
    
    1 person found this answer helpful.

  4. George Chrysovalantis Grammatikos 401 Reputation points MVP
    2022-09-16T18:25:59.837+00:00

    Hi @Vincent Chong ,

    Did you try to use the below parameters

    241965-image.png

    with the az group delete command?

    241890-image.png

    If the answer is helpful, please click "Accept Answer" and kindly upvote it.


  5. Vincent Chong 11 Reputation points
    2022-09-19T19:49:55.007+00:00

    It is also hanging using below command.
    I will try delete 1 resource at a time next.

    $ az group delete -n myResourceGroup --force-deletion-types Microsoft.Compute/virtualMachines