Remove-AzResource

This Azure PowerShell article will discuss the syntax and usage of the Remove-AzResource Azure PowerShell cmdlet with examples.

Remove-AzResource

If you don’t want an Azure resource anymore and wish to remove it, then you can use the Remove-AzResource Azure PowerShell cmdlet and easily remove the resource in seconds.

Syntax

Below is the syntax of the Remove-AzResource Azure PowerShell command.

Remove-AzResource

      -ResourceId <String>

      [-Force]
Remove-AzResource

      -ResourceName <String>
      -ResourceType <String>

      [-ResourceGroupName <String>]
      [-Force]

Well, let’s discuss an example of the usage of the Remove-AzResource Azure PowerShell cmdlet.

Example

Execute the below code that will help you to remove the TsInfoWeb website resource.

Remove-AzResource -ResourceId "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourcegroups/MyNewResGrp/providers/Microsoft.Web/sites/TsInfoweb" -Force

After executing the above PowerShell cmdlet, I got the output as “True” and the web resource has been deleted successfully without any issue.

You can check the output below

Remove AzResource 1

You may also like following the articles below

Wrapping Up

In this Azure article, we discussed the syntax and usage of the Remove-AzResource Azure PowerShell cmdlet with examples. Thanks for reading this article !!!