Issues with VM deletion

Renuka 1 Reputation point
2020-08-14T04:44:05.24+00:00

Hi Team,
I am facing issues while deleting virtual machine.
The virtual machine seems to be deleted but the underlying resources are still there and I am not able to delete them using CLI / powershell / Portal.

I tried deleting resource group but get below error :
Get-AzureRmResourceGroup -Name "dev" | Remove-AzureRmResourceGroup -Verbose -Force VERBOSE: Performing the operation "Removing resource group ..." on target "dev". Remove-AzResourceGroup: Long running operation failed with status 'Conflict'. StatusCode: 409 ReasonPhrase: Conflict OperationID :

Need your help for the same.

Thanks

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

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 101.9K Reputation points MVP
    2020-08-14T05:52:56.697+00:00

    Have you tried the PowerShell module "Az"?
    The "Az" module is the replacement for the "AzureRM" module.

    Introducing the new Azure PowerShell Az module

    Maybe this is helpful.

    Regards

    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)


  2. Andreas Baumgarten 101.9K Reputation points MVP
    2020-08-14T09:36:57.037+00:00

    This script runs here without any problem:

    $rgName = 'Test4Delete-rg' 
    New-AzResourceGroup -Name $rgName -Location 'North Europe'
    Get-AzResourceGroup -Name $rgName 
    Get-AzResourceGroup -Name $rgName | Remove-AzResourceGroup -Force
    

    Regards

    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)

    0 comments No comments