Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the az role assignments listed

I assigned a Service Principal to a VNET with

az role assignment create --assignee SP_CLIENT_ID --scope VNET_ID --role Contributor

Where can I review the configuration (Azure portal or cli)?

Update: I was looking for the subnets roles assignment which are a bit hidden under: vNet > Subnets > Managed users > Role assignments.

like image 875
Yannick Avatar asked Sep 12 '25 22:09

Yannick


2 Answers

Where can I review the configuration (Azure portal or cli)?

1.Use Azure portal:

Navigate to the vnet in the portal -> Access control (IAM) -> Role assignments -> search for the name of your service principal like below.

enter image description here

2.Use Azure CLI:

az role assignment list --assignee SP_CLIENT_ID --scope VNET_ID

enter image description here

like image 62
Joy Wang Avatar answered Sep 15 '25 17:09

Joy Wang


For future readers, if you tried to use Joy's answer to query for all roles assigned to a Managed Identity, and you're unexpectedly receiving an empty array, try adding the --all switch.

EX: az role assignment list --assignee '<PRINCIPAL_ID>' --all

The relevant docs are here.

like image 37
derekbaker783 Avatar answered Sep 15 '25 16:09

derekbaker783