0
votes

I've got one problem with the managed identity of an azure function. So here are my steps: 1. Create Azure Function 2. At "Platform Features" I've created/enabled the "System assigned" identity. 3. Now I want to create an secret key for this service principal, so I go to Active Directory -> App Registrations but there is no service principal.

I'm doing this because I want to do the following: https://wp.sjkp.dk/lets-encrypt-azure-functions-and-managed-service-identity/

1
If there is no service principal you need/can create one, right ?error404
The service principal is in the Enterprise applications not the App Registrations, select Application Type with All applications when you search, then you can find it.Joy Wang-MSFT
Yes I can see it in the Enterprise Applications, but for the Let's Encrypt Extension I need to create an SecretKey of this Application and this is only available in "App Registrations" ?bater
Yes, it is only available in App Registrations.Joy Wang-MSFT
Yes, but why isn't the service principal there?bater

1 Answers

1
votes

If you want to create a secret for the service principal, you could use the powershell New-AzureADServicePrincipalPasswordCredential.

Note: you need to make sure you have the permission to run the command, E.g. you are the global admin of your tenant.

New-AzureADServicePrincipalPasswordCredential -ObjectId <service principal objectid>

enter image description here

The application id of the service principal is the ClientId which used in the link you provided, the Value in the screenshot is the secret.

Update:

If we enable the MSI, the function app has two environment variables defined. The MSI_ENDPOINT and MSI_SECRET, the MSI_SECRET is the secret of the service principal.

You could find it in the Advanced tools (Kudu) of your function -> Environment.

enter image description here

Reference: https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity#using-the-rest-protocol