17

I have just created an AKS cluster using a standard az aks create ... --ssh-key-value .... According to https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal,

an AKS cluster is created, and because an existing service principal is not specified, a service principal is created for the cluster.

Where can I find the created SP? Thanks

JoaoCC
  • 295
  • 1
  • 3
  • 8

5 Answers5

22

As Bruno Faria said, you can find the service principal in Azure Active Directory, Azure Active Directory -> App registrations -> All apps like this:

enter image description here

Also you can use az aks list --resource-group <your-resouece-group> to find your service principal:

enter image description here

Hope this helps.

Jason Ye
  • 2,399
  • 1
  • 8
  • 10
  • This is what we were looking for. How to get the SP assigned to a specific cluster, which is especially relevant if you have several clusters and several non-AKS specific SPs. Thanx – JoaoCC Feb 12 '18 at 13:35
4

Go to Azure Active Directory >> App Registrations >> Select All Apps from the dropdown menu >> find your app and click on it.

The service principal will be the application Id and the secret will be the key under settings.

Bruno Faria
  • 3,804
  • 1
  • 11
  • 18
  • I went there, and there are several apps, none of them with the name of the created cluster. What I was looking to understand is how do I know which of these has been assigned to the newly created cluster. Thx – JoaoCC Feb 11 '18 at 21:01
  • Well, I just noticed that `~/.azure/acsServicePrincipal.json` has `service_principal`with the same value as one of the apps' `ApplicationID`. Curiously, in the portal, this app has a link to `Create Service Principal`. Is this ok? Thx – JoaoCC Feb 11 '18 at 21:09
2

The output from "az aks list" should contain your service principal clientId.

Jerry Joyce
  • 121
  • 1
1

Try with this

az aks list --resource-group core-project --query="[0].servicePrincipalProfile.clientId"
nikoskip
  • 111
  • 3
0

Refer this link for step by step guide for app registration in Azure AD - https://sanganakauthority.blogspot.com/2019/04/how-to-create-service-principal-or-app.html

kunal
  • 101
  • 1