I have a Dot Net Core Web API developed , deployed and running in Azure. It serves as API Gateway for now. I would like to serve HTML content when user hits the root of the url in browser.
And our website content is published to azure storage behind CDN with Static Web Site. I followed the steps from below link and set it up.
https://microsoft.github.io/AzureTipsAndTricks/blog/tip203.html
How do we serve this content in my dot net core web api from azure storage and return that content to browser.
I have the below code which works for content i have locally.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
});
}
Should i read the content of azure storage under static website blob and return it or just do the redirection to Static WebSite or CDN url.
I am trying to follow the architecture with ocelot as suggested in the answer 2 below




I can change launchUrl value to: http://localhost:4343 to point it to root to return index html. But not sure how to return azure cdn content.What do you mean by this statement? Do you mean you want to publish it to Azure for hosting?azure web appfor api, and want to serve static content byazure static web app.