3

Trying to use a custom font in a simple static content website publish via git to azure. The website project isn't wrapped in a Visual studio solution. There is no web.config so how can I get the custom font to work or any static content such as .json files to be accessible?

This solution implies your using visual studio which I am not. How to include a non-standard font-face in azure?

My exact error is:

Failed to load resource: the server responded with a status of 404 (Not Found) http://fakewebsitename.azurewebsites.net/fonts/fontawesome-webfont.woff?v=4.0.3
Community
  • 1
  • 1
TealFawn
  • 329
  • 4
  • 14

1 Answers1

10

you just have to add a MIME type for the font in your web.config it will look something like this for your woff font

<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".woff" /> 
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
         </staticContent>
    </system.webServer>
</configuration> 

IIS by default will prevent download of static files you don't specify MIME types for.

Edit: added <remove fileExtension=".woff" /> based on @TealFawn suggestion

ahmelsayed
  • 7,125
  • 3
  • 28
  • 40
  • 1
    Excellent that helped almost perfectly. I just copied that into a file called the file web.config, in the root folder. I did have to add one change my final result was: – TealFawn May 26 '14 at 12:56