Automate deployment of AD B2C for use with Function App

Markus Tacker 21 Reputation points
2020-06-26T11:06:36.227+00:00

I've been pulling my hairs out this week writing down the setup guide for an Azure Function App that uses AD B2C authentication.

This is the sad state of affairs right now to get it set up: https://bifravst.gitbook.io/bifravst/bifravst-on-azure-wip/continuousdeployment
... because it cannot be automated.

Yes, AWS Cognito is a beast as well, but at least it can be deployed through code... which makes the whole setup process a one liner with AWS CDK...

Is there by any chance a "Deploy to Azure" button sample of a Function App with AD B2C authentication that I can have a look at? It must be possible to make it simpler ...

Imagine I want to continuously test the solution in blank Azure Accounts to ensure it works and that the configuring the Function App authentication is done properly for new setups.

How do you achieve that?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,684 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Saurabh Sharma 23,766 Reputation points Microsoft Employee
    2020-06-27T00:14:23.013+00:00

    @Markus Tacker Unfortunately, I do not see any sample for automatic deployment of Azure AD B2C with Function App. I, however, am checking internally with the products team the possibility of automating this along with public availability of any samples for the same.

    0 comments No comments

  2. Dhivya G - MSFT Identity 11 Reputation points Microsoft Employee
    2020-07-01T08:30:24.637+00:00

    I have attached the documentation on how to configure an Azure function for B2C authentication. This documentation should help you to secure your function app with Azure AD B2C authentication.


  3. Markus Tacker 21 Reputation points
    2020-07-03T09:49:57.377+00:00

    I have started to implement end-to-end tests for the solution, where I need to acquire user credentials programmatically to interact with the Function API endpoint programmatically to enable continuous integration of the solution (which is the goal, as mentioned in the initial post).

    For that I need to go through yet another manual process to set up programmatic access to AD B2C: https://learn.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-get-started?tabs=app-reg-ga