gevjen gevjen - 1 year ago 83
JSON Question

Azure deployment with .json file extension

We are deploying an azure package where we have a static .json file. We have this working through the azure emulator and locally. but our application just spins when we run it in azure. We are getting a 404 on the app.json file. We have added the mime type to our local iis with the appropriate handler, below is what we have in our web.config. We have set the mime type of application/x-javascript but that didnt work either.

<mimeMap fileExtension=".json"
mimeType="text/html" />
<add name="JSON"
preCondition="bitness64" />

Answer Source


    <mimeMap fileExtension=".json" mimeType="text/html" />

to my web.config in an Azure instance worked just fine. Most likely, your deployed web.config isn't configured properly. To check it out, enable RDP, connect to your Azure instance and browse to your web.config. Then you can fiddle with your web.config until you get things working.

Because you're serving up a static .json file, you don't need to add a .json HTTP handler. Also, the offical mime type for .json is application/json.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download