Hi Henrik Brøgger,
You're trying to host dynamically generated dashboards with fast updates and Azure AD authentication, and you're weighing different hosting options in Azure.
Recommended Solution: Combine Azure Storage with Azure AD Authentication
To meet your requirements, I suggest combining Azure Storage Static Website Hosting with an Azure Function or Azure Front Door to handle authentication. Here’s a breakdown:
Step 1: Host Static Files in Azure Blob Storage
- Azure Blob Storage can serve your dynamic content (dashboard folders) instantly. You simply upload the dashboard HTML, CSS, and other assets to a $web container, and they are accessible via a URL
- Dynamic Updates: As new folders are uploaded, they will be instantly available via their respective URLs, without requiring a rebuild or redeployment.
reference : https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-host?source=recommendations
Step 2: Implement Authentication with Azure AD (via Azure Front Door or Azure Functions)
Option 1: Azure Front Door
Azure Front Door acts as a reverse proxy and can provide custom routing for your content. It can authenticate requests using Azure AD by integrating with Azure AD B2C (if needed) or standard Azure AD.
Flow: When a user accesses a dashboard, Front Door checks if the user is authenticated using Azure AD. If they are not authenticated, Front Door redirects them to the Azure AD login page. Once authenticated, they can access the requested dashboard.
Option 2: Azure Functions (Authentication Proxy)
If you prefer more control over the authentication flow or need to do additional processing, you could use an Azure Function as a proxy.
The function could check if a user is authenticated (using Azure AD) before forwarding the request to the Azure Blob Storage URL.
The Function would essentially serve as a secure access point to the Blob Storage, enforcing authentication before returning the requested dashboard.
Step 3: Configure Azure AD Authentication
- Set up Azure AD: You'll need to register your app with Azure AD in the Azure portal.
- Use Azure AD Authentication: Both Azure Front Door and Azure Functions can be configured to use Azure AD authentication by setting them up to authenticate with OAuth 2.0 or OpenID Connect via Azure AD.
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards,
Vishvani