I am working on a new project to host a Multi-Tenant Application using the following technologies: Blazor Server Side, Hosted on an Azure App Service, Using Azure SignalR, using Feature Toggles in Azure App Configuration and Secured with Azure Active Directory and the Gateway will use Azure Front Door.
I have Azure Front Door configured with multiple DNS Entries with rules setup to evaluate the Route and inject a custom Header in the Request Object with the Customers Unique ID.
I need to be able to retrieve the Header and then dynamically set the Theme, Logo, Connection String, etc. for this customer within the Blazor Server Side Application.
I have tried Finbuckle. That worked initially, but does NOT work using Azure SignalR. I need to use Azure SignalR, because that is the only way Web Sockets are supported using Azure Front Door. And the only recommendation is to use HttpContextAccessor, which is not reliable.
I don't know how to read the Request in the Program.cs and store it to use in the MainLayout.razor OnInitializedAsync to set the theme prior to Render. I don't know if Middleware will work, as that will be outside the scope of the WebSocket request due to using Azure SignalR.
I am trying to read it in the App.razor.cs as there it appears you can read the HttpContext, but I don't know where to store it, as ProtectedSessionStorage is not available at that time.
So the question is, what is the recommendation to create a Multi-Tenant App, on blazor Server hosted in Microsoft Azure. It seems there should be a solution to this, as its all put together in the Microsoft ecosystem.
Any ideas, concepts, etc. would be appreciated.
Thanks,
Tom