Skip to content

Not able to consume the Token Binding in Azure function with Management API (V2 version). #1

@paragdumbre

Description

@paragdumbre

Our team is trying to use the Microsoft Graph auth token input binding for an Azure Functions with management API version V2. We are using "client credentials" binding, where the function can directly authenticate itself to AAD and interact with the Graph API.

We have used the easy Auth and have provided the App (which is whitelisted in the tenant and have the permissions specified). Also, added secret in "MICROSOFT_PROVIDER_AUTHENTICATION_SECRET" field in app settings and have the secret of the above application mentioned there.

Image

With the below code snippet from the TokenOptions.cs, it could be seen that the WEBSITE_AUTH_CLIENT_ID, WEBSITE_AUTH_CLIENT_SECRET and WEBSITE_AUTH_OPENID_ISSUER are required for Client credentials flow.

Image

While local debugging, if we provide the above fields in "local.setting.json", we are getting the valid token, and everything seems to be working correctly. However, when deployed to Azure, we could get the information of Issuer and Client Id in the constructor through environment variables, but Client Secret is appearing as null and hence, token-binding is failing and function not able to proceed further.

Is there any way to get the value for WEBSITE_AUTH_CLIENT_SECRET or assign value from MICROSOFT_PROVIDER_AUTHENTICATION_SECRET to the WEBSITE_AUTH_CLIENT_SECRET?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions