Set-AzResourceGroup

In this Azure PowerShell article, we will discuss the syntax and usage of the Set-AzResourceGroup Azure PowerShell cmdlet with examples of how to use the Set-AzResourceGroup PowerShell command.

Set-AzResourceGroup

Set-AzResourceGroup is an excellent Azure PowerShell cmdlet that can help you to modify your Azure resource group in seconds.

Syntax

Below is the syntax of the Set-AzResourceGroup Azure PowerShell cmdlet.

Set-AzResourceGroup
   -Name <String>
   [-Tag] <Hashtable>
Set-AzResourceGroup
   [-Tag] <Hashtable>
   -Id <String>

Let’s discuss how to use the Set-AzResourceGroup command with an example.

Example

Below Azure PowerShell, cmdlet will add a Services tag with the value “Azure” to the “DEMORG1” Resource Group.

Set-AzResourceGroup -Name "DEMORG1" -Tag @{Services="Azure"}

This command applies a Department tag with a value of IT to a resource group with no existing tags.

After executing the above Azure PowerShell cmdlet, I got the output below, and the Resource Group tag has been added successfully.

PS C:\Users\Bijay> Set-AzResourceGroup -Name "DEMORG1" -Tag @{Services="Azure"}


ResourceGroupName : DEMORG1
Location          : eastus
ProvisioningState : Succeeded
Tags              : 
                    Name      Value
                    ========  =====
                    Services  Azure
                    
ResourceId        : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups
                    /DEMORG1

You can see the same output as below

Set-AzResourceGroup

Set-AzResourceGroup – Video Tutorial

You may also like following the below Azure PowerShell articles

Wrapping Up

In this Azure PowerShell article, we have discussed the syntax and usage of the Set-AzResourceGroup Azure PowerShell cmdlet with an example. Thanks for showing interest in reading this article !!!