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.
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.
2.Use Azure CLI:
az role assignment list --assignee SP_CLIENT_ID --scope VNET_ID
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With