You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a service principal like this: az ad sp create-for-rbac --name mySP ...
and you want to show it. You have to use the URI not the name: az ad sp show --id http://mySP
The help text for the show command states that --id should be "Service principal name, or object id."
Took me some time to figure out that the name I input for the create-for-rbac command is converted to a URI and that is what the show command needs as input.
It is not logical to me that it works like this and I assume it might stump others as well.
It would be nice with a description of this and some examples.
I don't know much about service principals and I am only using this to be able to create an AKS cluster.
[Enter feedback here]
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: e99d25ff-03e2-e015-37f4-a29b59ec50d4
Version Independent ID: 1a8e88ed-72c7-fbe7-b0ad-68f23b3946cd
The text was updated successfully, but these errors were encountered:
tjprescott
added
Graph
az ad
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
labels
Jun 18, 2018
so - this was bugging me too. I think the commands are inconsistent.
Other commands have a --spn argument, but this one has a --id argument that can either be a SP name or an id. az ad sp show --id <longid works>
Also, even though the docs say you can use a SP uri - when you do: az ad sp list --output table
For me, it lists the homepage (SP name URI) as https://azure-cli-2018-10-21-07-43-17 (note https and not http).
When I do: az ad sp show --id https://azure-cli-2018-10-21-07-43-17 it fails. But when I do az ad sp show --id http://azure-cli-2018-10-21-07-43-17 it works fine.
For context, the goal of create-for-rbac is to simplify everything, but it goes a bit too far by auto-fixing the a non-uri based name w/o communicating it.
I will update the help and also output a warning telling you that we are adding the "http://" prefix to get the provision work.
When you create a service principal like this:
az ad sp create-for-rbac --name mySP ...
and you want to show it. You have to use the URI not the name:
az ad sp show --id http://mySP
The help text for the show command states that --id should be "Service principal name, or object id."
Took me some time to figure out that the name I input for the create-for-rbac command is converted to a URI and that is what the show command needs as input.
It is not logical to me that it works like this and I assume it might stump others as well.
It would be nice with a description of this and some examples.
I don't know much about service principals and I am only using this to be able to create an AKS cluster.
[Enter feedback here]
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: