user1655072
user1655072

Reputation: 672

How do I specify a specific resource group I want to update in azure CLI?

I am following the CLI from the official azure doc. Specifically, I am looking for a way to add a tag to a storage account in Azure through CLI. It looks like az storage account update allows me to do that.

But how do I specify the name of the storage group? Can anyone provide me with an example?

Upvotes: 1

Views: 843

Answers (2)

SCouto
SCouto

Reputation: 7928

Why don't you try this:

az resource update --set tags.'<tagName>'='<tagValue>' -g <your_rg> -n <your_sa> --resource-type "Microsoft.Storage/storageAccounts"

As seen here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources

Or this:

az storage account update --name <your_sa> --resource- group <your_rg> --tags “<tagkey>= <tagvalue>”

Upvotes: 1

user1655072
user1655072

Reputation: 672

After some trial and error, I have found that below line worked for me:

az storage account update --name storage_account_name --tags 'tag_name=tag_value'

Upvotes: 2

Related Questions