1
votes

I have an Azure AD B2C Tenant, with 2 applications created and configured to work together as front-end and back-end. The front-end application is a single-page node.js app with the corresponding MSAL.js library configured to login with my Azure AD B2C tenant, then tokens are generated to be validated by the back-end. The back-end application is an Azure Function App running in the cloud (HttpTrigger functions), which works with my Azure AD B2C Tenant Authorization/Authentication through EasyAuth. So all my functions in my Azure Function App will required an Authorization Header. Currently, my front-end can B2C Login, acquire silently my token, call to an azure function in the cloud, passing in the token obtained, the function is validating the token and the function runs smooth.

So now, I want to create my Azure Function project in VS 2017 and make sure I can develop/test locally to deploy later my azure functions to the cloud. I created an Azure Function Project in VS2017 targeting .Net Framework 4.6.1 and created one azure function. I added the application in the Azure AD B2C Tenant and configure it. So now I have in my project 3 files, function1.cs, host.json and local.settings.json.

How can I configure my Azure Function Project in VS2017 to use Azure AD B2C EasyAuth, the same way I did in the cloud? If I check the Automation Scripts I can see in the Microsoft.Web/sites/config resource, there is a siteAuthSettings, so I assume in my VS2017 Azure Function project I need to update local.settings.json with something?.

Automation Script - Microsoft.Web/sites/config

There is no documentation (or I couldn't find it) about what should I add in my local.setting.json to run. Any Help out there?

1
EasyAuth and B2C are different this. Did you read this blog post?spottedmahn

1 Answers

0
votes

AFAIK, the Azure function doesn't support testing the relative authentication on local as on Azure portal.

If the business logic of Azure function is not rely on the authentication, you may test the function without authentication on localhost.

And if you want the Azure function also support the authentication feature, you may submit the feedback from this link.