- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to apply a tag to the azure resource group using PowerShell?
Like Azure VM, we can apply the azure tags to the resource group or any other resources. The tagging works on the resource ID and in azure, all the resources come with the resource ID property.
To apply the tag to the azure resource group, we first need to use get the resource group details to use its resource ID. The below code shows that how we can apply the new tag to the azure resource group.
Example
PS C:\> $rg = Get-AzResourceGroup -Name AnsibleTestRG PS C:\> $tag = @{Owner='Chirag'; CostCenter='USFinance'} PS C:\> New-AZTag -ResourceId $rg.ResourceId -Tag $tag -Verbose
Output
- Related Articles
- How to delete the Azure Resource Group using PowerShell?
- How to get the Azure resource group using Azure CLI in PowerShell?
- How to create a new Azure resource group using PowerShell?
- How to retrieve the Azure VM resource group using PowerShell?
- How to get the azure resources from the resource group using PowerShell?
- How to check if the Azure resource group is empty or not using PowerShell?
- How to change the Azure tag value using PowerShell?
- How to get the applied azure resource tags using PowerShell?
- How to add the tag of Azure VM using PowerShell?
- How to add the new tag to Azure VM using PowerShell?
- How to delete all the tags of the azure resource using PowerShell?
- How to delete the specific tag of Azure VM using PowerShell?
- How to retrieve the Azure VM network security group (NSG) using PowerShell?
- How to connect to the Azure subscription using Azure CLI in PowerShell?
- How to list the Azure VMs using Azure CLI in PowerShell?

Advertisements