question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to update or set tags for multiple resource IDs

See original GitHub issue

Describe the bug

Command name: az resource update

Errors:

Couldn't find 'tags' in ''. Available options: index into the collection '' with [<index>] or [<key=value>]

To Reproduce:

Try to set or update tags for multiple resource IDs at once.

> az group create --location westeurope --name rg-test-1
{
  "id": "/subscriptions/<subscription ID>/resourceGroups/rg-test-1",
  "location": "westeurope",
  "managedBy": null,
  "name": "rg-test-1",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}

> az group create --location westeurope --name rg-test-2
{
  "id": "/subscriptions/<subscription ID>/resourceGroups/rg-test-2",
  "location": "westeurope",
  "managedBy": null,
  "name": "rg-test-2",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}

> az resource update --ids /subscriptions/<subscription ID>/resourceGroups/rg-test-1 /subscriptions/<subscription ID>/resourceGroups/rg-test-2 --set tags.test=value
Couldn't find 'tags' in ''. Available options: index into the collection '' with [<index>] or [<key=value>]

Expected Behavior

Environment Summary

Linux-5.8.6-201.fc32.x86_64-x86_64-with-glibc2.2.5
Python 3.8.5
Installer: PIP

azure-cli 2.11.1

Additional Context

I tested this with snapshots, virtual machines, and resource groups. It doesn’t seem to matter whether the tags already exists or not, whether the IDs are surrounded by quotes, whether the --set portion is surrounded by quotes, whether --set is specified multiple times (for multiple tags); it will still fail.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
qwordycommented, Jan 18, 2021

I got the same result.

[
  null,
  null
]

Confusing output. We will investigate it and improve output content.

1reaction
zhoxing-mscommented, Nov 29, 2020

@qwordy Could you please help to see the questions related to az disk revoke-access and az disk delete?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you update many azure tags simultaneously?
Find id's of type resources which you want to update tags. You can run query in "Azure Resource Graph Explorer" · Copy Paste...
Read more >
Use tags to organize your Azure resources and ...
To remove specific tags, use Update-AzTag and set -Operation to Delete . Pass the resource IDs of the tags you want to delete....
Read more >
Tag your Amazon EC2 resources - AWS Documentation
Manage your Amazon EC2 instances, images, and other resources by assigning your own metadata tags.
Read more >
Create Update and Delete Tags on Azure Resource
On this page · What is Tag in Azure Resources? · Apply tags to Azure Resource · View Tag on Azure Resource ·...
Read more >
Creating and managing tags | Resource ...
If you want to add tag values to this key, click add Add value for each tag ... its parent resource, and a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found