Azure / Azure/azure-cli

Odd error message when specifying ARM resource ID in role assignment

Open
#18,524 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-identity-squad feature-request RBAC
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**
When a user specifies an ARM resource ID for a principal as part of a role assignment, the error message returned is not particularly helpful to explain that a resource ID is not a valid input. This may be confusing for a user, given that the target resource is specified as an ARM resource ID in the same command.

Similarly when assigning a user-assigned managed identity to a resource, the ARM resource ID is used, not the object/principal ID.

A more meaningful error message would help reduce confusion.

**To Reproduce**
1. Add role assignment, specifying an ARM resource ID for the assignee - e.g. `az role assignment create --role "Storage Blob Data Reader" --scope /subscriptions//resourceGroups/cliResourceGroup/providers/Microsoft.Storage/storageAccounts/ --assignee /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/`
2. Observe error message

**Expected behavior**
1. The user should get an error message specifying the acceptable inputs that are required. Ideally it would specifically say to use one of these rather than an ARM resource ID.

**Environment summary**
Terminal on OSX
```
az --version
azure-cli 2.25.0

core 2.25.0
telemetry 1.0.6

Extensions:
account 0.2.1
```

**Additional context**

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.