Azure and .json mimeType without web.config
This should work:
<system.webServer> <staticContent> <remove fileExtension=".json" /> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent></system.webServer>
This doesn't make any difference to your overall IIS configuration, it just conditionally removes the mimeMap from the configuration of this particular site (as governed by this web.config
) before adding it again.
You can create a startup task that adds the mime type on IIS level. This way you won't need to include it in your web.config:
"%windir%\System32\inetsrv\appcmd.exe" set config /section:staticContent /+"[fileExtension='.json',mimeType='application/json']"exit /b 0