"az ad sp create-for-rbac" should set sensible defaults
"az ad sp create-for-rbac" does not set sensible defaults and the resulting principal is not very usable. It would be great if it would setup defaults as the following "az ad sp create-for-rbac --role contributor --scopes /subscriptions/SUBSCRIPTIONID".
@anhowe, you can use az role assignment create to create new ones at any time. The help of az ad sp create-for-rbac calls out the format: az ad sp create-for-rbac -n "http://my-app" --role contributor --scopes ...
Does that help? Or you feel it unlikely you will create any other assignments in future so you like to get all done at one shot?
Two people hit this so far. Two possible solutions:
- by default for command "az ad sp create-for-rbac", assign "--role contributor --scopes /subscriptions/SUBSCRIPTIONID"
- give an error if the customer does not set role or scopes (and override with --force if they really want no roles or scopes)
+1 I'm not sure how much value there is in an SP with no roles or scopes. Since providing sensible defaults seems to be a goal for the CLI (e.g. vm create), it seems like it would make sense to add some prescription to the az ad sp create-for-rbac command in order to simplify it.
Thanks for the data. I will do the change