If you want to know how to install the PowerShell Az module on your machine, check out this
link. The simplest way to get started is to sign in interactively at the command line.
Login-AzAccount
If you have more than one subscription associated with your mail account, you can choose the default subscription. To perform this task we will use the following commands:
Once you set your default subscription, you are ready to add tags to your Azure Resources.
List all tags and their number of occurrences in your Azure subscription using PowerShell>
List all tags and their number of occurrences in your Azure subscription using PowerShell
#
You can view all tags and their number of occurrences in your subscription using the Get-AzTag cmdlet. The Count property shows how many times the tag has been applied to resources and resource groups in your subscription.
To add a Tag to a Resource (Virtual Machines, Virtual Networks, etc ) with Azure PowerShell, use the Set-AzResourceGroup cmdlet with the following syntax:
If you apply tags to a resource or resource group, overwrite existing tags in that resource or resource group. For this reason, we must use different methods to add tags to the resource or resource group that already has tags applied. To add a tag to a resource group that has existing tags, use :