Hi @Likitha Bommasani ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
To implement app authentication for your Azure Functions using Azure AD B2C, you can follow these steps:
- Make sure your Azure AD B2C tenant is set up with the required user flows for sign-up and sign-in. This configuration will enable the issuance of access tokens and ID tokens.
- In the Azure portal, go to your Azure Function App. In the "Authentication" section, click on "Add identity provider." Select "Azure Active Directory" and configure it to connect to your Azure AD B2C tenant. You will need to enter the required information, including the tenant ID and application ID.
- Make sure your Azure Function is configured to accept tokens from Azure AD B2C. This usually requires setting the Audience in your Azure Function's authentication settings to correspond with the application ID of your Azure AD B2C application.
- Azure Functions will automatically validate the tokens issued by Azure AD B2C, provided that the authentication is set up correctly.
- Additionally, you can implement further checks in your function code to verify the token claims as necessary. After completing the configuration, test your Azure Function by signing in using your Azure AD B2C user flows to ensure that the access tokens are accepted and verified correctly.
Also, for your better understanding, please refer to the following documentations:
Create a REST API for a token issuance start event in Azure Functions
Authentication and authorization in Azure App Service and Azure Functions
I hope this helps! Let me know if you have any further questions or need additional assistance.