title: How to serve Static WebSite content through Dot Net core Web APi in Azure
body: <p>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.</p>
  <p>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.</p>
  <p><a href="https://microsoft.github.io/AzureTipsAndTricks/blog/tip203.html" rel="nofollow noreferrer">https://microsoft.github.io/AzureTipsAndTricks/blog/tip203.html</a></p>
  <p>How do we serve this content in my dot net core web api from azure storage and return that content to browser.</p>
  <p>I have the below code which works for content i have locally.</p>
  <pre><code>        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
              else
              {
                  app.UseExceptionHandler(&quot;/Home/Error&quot;);
                  app.UseHsts();
              }
  
              app.UseHttpsRedirection();
  
              app.UseStaticFiles();
  
              app.UseRouting();
  
              app.UseAuthorization();
  
              app.UseEndpoints(endpoints =&gt;
              {
                  endpoints.MapDefaultControllerRoute();
              });
          }
  </code></pre>
  <p>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.</p>
  <p>I am trying to follow the architecture with ocelot as suggested in the answer 2 below</p>
  <p><a href="https://stackoverflow.com/questions/53477140/asp-net-core-api-gateway-middleware">ASP.NET Core Api-Gateway middleware</a></p>