Unable to add a new MIME type to an Azure Web App web server

George Parrish 1 Reputation point

I am hosting some static files on my Azure Web App web server.

I am able to access most of these static files when request them through my web browser.

However any files which have a file extension of ".data" are causing the web server to return a 404 error.

I have modified the existing web.config file ( which I found in the root of the web server) adding a new MIME type to this file, for files with extension ".data".

After doing this I found that the web server still responds with a 404 when I request these files through my web browser.

Please advice how I successfully add a new MIME type to an Azure Web App web server?

My web.config file looks like this

<?xml version="1.0" encoding="utf-8"?>

        <remove fileExtension=".data" />
        <mimeMap fileExtension=".data" mimeType="application/octet-stream" />

        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

    <aspNetCore processPath="dotnet" arguments=".\MyWebApp.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />



Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,155 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Oscar Maqueda 536 Reputation points Microsoft Employee

    If the <staticContent> element already exists you just need to add the <mimeMap> element to this section for the type you want to add, try to delete the remove paragraph

    0 comments No comments

  2. George Parrish 1 Reputation point

    The <staticContent> section didnt already exist, I'm not sure why you think that it already existed? I had to add it, as shown in the code snippet.

    0 comments No comments

  3. George Parrish 1 Reputation point

    To clarify, I added this to the <system.webServer> section of the web.config file ( as shown above ), and the web server still reports 404s for files with extension ".data"

             <remove fileExtension=".data" />
             <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    0 comments No comments