Azure / Azure/azure-cli

Unable to update or set tags for multiple resource IDs

Open
#15,106 5 comments 0 reactions 1 assignee Assigned to @zhoxing-ms View on GitHub
act-identity-squad ARM customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Describe the bug

**Command name:**
`az resource update`

**Errors:**

```text
Couldn't find 'tags' in ''. Available options: index into the collection '' with [] or []
```

## To Reproduce:

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

```console
> az group create --location westeurope --name rg-test-1
{
"id": "/subscriptions//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//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//resourceGroups/rg-test-1 /subscriptions//resourceGroups/rg-test-2 --set tags.test=value
Couldn't find 'tags' in ''. Available options: index into the collection '' with [] or []
```

## 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.