Serving a file with no extension from an Azure Web App

Guillermo Rodriguez 0 Reputation points
2023-11-10T17:15:00.92+00:00

I'm trying to serve a text file that has no extension from within a Web App.

The file is located in the .well-known folder. Other files (with json extension) from the .well-known folder are accessible, but when I try to access the file with no extension, the app redirects to the home page.

I modified the web.config and added support for 2 mime types with no positive results.

The content of the web.config as it is now is listed below:

?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\Slp.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
<staticContent> 
          <mimeMap fileExtension=".json" mimeType="application/json" />
          <mimeMap fileExtension="." mimeType="application/json" />
</staticContent>
    </system.webServer>
  </location>
</configuration>
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
628 questions
{count} votes