How to delete the Azure Resource Group using PowerShell?


To delete the azure resource group using PowerShell, we need to use the Remove-AZResourceGroup command. But before using this command, make sure that no usable resources exist in the resource group that you want to delete.

To check if the resources are available in the resource group, use the below command. Here we are using the TestRG resource group name.

Example

Get-AzResource -ResourceGroupName TestRG

Once you are confirmed that you need to delete the Resource Group then use the below command to delete the resource group.

Example

Remove-AzResourceGroup TestRG -Force -Verbose

When you use the -Force parameter, you won’t be prompted for deletion confirmation.

Updated on: 12-Apr-2021

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements