Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
The cloud engineer in my organization has set up an Azure KeyVault and a Service Principal. I know the id of this Service Principal, but I also need
clientId
,
clientSecret
, and
tenantId
.
The documentation
shows that these variables are exposed to you when you create a Service Principal using Azure CLI, but in my case, there is one already. I don't have the credentials to create a new one, and frankly speaking, I don't need to.
So, how can I retrieve the
clientId
,
clientSecret
, and
tenantId
associated with the existing Service Principal?
–
You can get the Service Principal's
Client Id
and
Tenant Id
using CLI command like below:
az ad sp list --query "[].{id:appId, tenant:appOwnerTenantId}"
You can even get many more values of the Service Principals - refer to ServicePrincipalInner class.
Further, as mentioned in the comments, you cannot retrieve the Client Secret
created by somebody else. You will have to reset it:
az ad sp credential reset --name APP_ID
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.