Azure Functions local authentication with Azure AD B2C

Viewed 855

Is it possible to use Azure AD B2C authentication in a localhost Azure Functions project? If yes, how can this be done?

There are examples of using Azure AD B2C authentication for local ASP.NET Core projects, but I have not seen any examples for local functions projects.

1 Answers

As Azure Function is designed to run a small spice of code. You can not add AAD authentication to it as you do to an ASP.NET project directly.

Some ideas:

  1. For cloud environment, you can integrate AAD authentication from Azure portal. Here is a tutorial: ADDING AZURE AD B2C AUTHENTICATION TO AZURE FUNCTIONS

  2. You can always manually get the authentication header from a http request. And then manually verify the token you get to see if it is authenticated.

Related