'Where do you find the app id / tenantId for an azure function?

If i'm using an azure function that is based on a consumption plan, where would I find the application ID and tenantID? In this case, it's not connected to any app service.

At this time, I need the info to retrieve a token to access a key vault locally. Azure function does provide a service principal, but I can only use that to retrieve the token successfully on the deploy azure function. However, when I run it locally the rest call fails. Also note: I'm not doing this in .net so I can't rely on the .net library that does this automatically for you.

Thanks, Derek



Solution 1:[1]

It's not possible to fetch the MSI credentials from outside the function app. One thing you could try is to create an HTTP trigger that returns the values of MSI_ENDPOINT and MSI_SECRET. That will allow you to at least know what they are for simulating your function code locally.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris Gillum