2
votes

I have multiple Azure Functions apps and a Single Page App that connects directly to them.

Currently, the Single Page App (static html/js content) is deployed to as an App Service Web Application with EasyAuth AAD Authentication enabled.

Is it possible to share the authentication cookie / header or whatever with the Azure Functions apps?

If no, what is the solution? I want the user to log in once and be authenticated everywhere.

1

1 Answers

0
votes

The issue your dealing with here is CORS. To allow your Single Page App to call the Azure Functions without additional authentication you need to ensure that your Single Page App and Azure Function are exposed over the same domain.

There are a few ways to do this.

  1. You can use a service like Azure Traffic Manager and a custom domain to ensure your functions and web app are on the same domain
  2. You can set up an Azure Function Proxy as your front end and then have all the other functions (including the web app) routed through the proxy. This way all the urls will appear to be from the same domain and the authentication will work seamlessly.