Authentication between Azure Functions and Angular running on an App Service

krystian polak 1 Reputation point
2022-05-20T15:59:36.37+00:00

I have an Angular SPA hosted on an app service that has some basic features - view products, log in, purchase, etc. I am using azure functions on the backend to keep things quick and easy, but I'm seeing some issues with authentication.

  1. using built in azure authentication, it doesn't seem like you can have a mix of authenticated APIs and unauthenticated HTTP trigger functions - so to use this feature would I have to create a second function app to house the unauthenticated APIs? Isn't there a simple attribute that can be added to the functions above the signature like in MVC?
  2. It doesn't seem like I can use a managed identity with MSAL for Angular. I am planning on having users log in using Azure AD B2C so that they can log in with their private emails, social, etc - but if I do that then I will need to grant API access to those credentials, not something like a traditional service account. Is there a better way to do this?

Thanks,
Krystian

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,195 questions
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,631 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,339 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,471 Reputation points Microsoft Employee
    2022-05-26T03:55:43.383+00:00

    Apologies for the delayed response @krystian polak . According to this wiki for Microsoft.Identity.Web, you can configure your function app just like any regular web api requiring authentication. You should be able to configure your Azure Function to receive a bearer token passed from your React front end. If you run into any issues, please do comment down below.

    0 comments No comments