title: Fetching swagger-ui returns 404 in a ASP.NET Core 3.1 app in Azure
body: <p>When loading the /swagger/index.html page the browser can't find the swagger-ui resources required when deployed to an App Servicce in Azure, returning 404. It works when running locally. My setup is:</p>
  <pre><code>  services.AddSwaggerGen(options =&gt;
    {
        options.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo
        {
            Title = &quot;Nexus WebApp&quot;,
            Version = &quot;v1&quot;
        });
        options.CustomSchemaIds(type =&gt; type.ToString());
                 
    });
  </code></pre>
  <pre><code> var builder = endpoints.CreateApplicationBuilder();
  
   builder.UseSwagger();
  
   builder.UseSwaggerUI(options =&gt;
   {
       options.SwaggerEndpoint(&quot;/swagger/v1/swagger.json&quot;, &quot;Nexus WebApp&quot;);
   });
  
   var pipeline = builder.Build();
  
   endpoints.Map(&quot;/swagger&quot;, pipeline)
       .RequireAuthorization(new AuthorizeAttribute());
   endpoints.Map(&quot;/swagger/index.html&quot;, pipeline)
       .RequireAuthorization(new AuthorizeAttribute());
   endpoints.Map(&quot;/swagger/{documentName}/swagger.json&quot;, pipeline)
       .RequireAuthorization(new AuthorizeAttribute());
  </code></pre>
  <p>I've tried with a relative path fro the swagger endpoint like so <code>..\swagger\v1/swagger.json</code>, I've tried specifying a RoutePrefix all to no avail unfortunately. I'm aware similar questions have been asked but unfortunately none seem to help.</p>
  <p>Does anyone have any clues?</p>
  <p><strong>Update</strong></p>
  <p>These are the resources it is returning 404 for:</p>
  <ul>
  <li>https://{domain}/swagger/swagger-ui.css</li>
  <li>https://{domain}/swagger/swagger-ui-standalone-preset.js</li>
  <li>https://{domain}/swagger/swagger-ui-bundle.js</li>
  </ul>