Using managed identities to invoke a http triggered function app inside another function app

Viewed 24

Need some help being pointed in the right direction. Struggling to find an appropriate resource. I've got a Http triggered function within a function app that I need to invoke from another function app. How can I authenticate this call using system managed identities?

The two function apps are .Net 6 isolated functions.

1 Answers

You can use ManagedIdentityCredential from Azure.Identity Nuget package to get an access token for the other Function app.

Note that you need an app registration for the Function that you will call as you can't acquire an access token for the other Function's Managed Identity. You can acquire the access token using scope app-registration-client-id/.default.

Note you must implement authorization in the other Function to properly check the token claims. For example, you can check that the caller is the other Managed Identity. Optionally, you can define an app permission/app role that you assign to the Managed Identity.

Related