TealFawn
TealFawn

Reputation: 339

How to include a non-standard font-face in azure hosted website without using visual studio?

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

Upvotes: 3

Views: 1418

Answers (1)

ahmelsayed
ahmelsayed

Reputation: 7392

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

Upvotes: 10

Related Questions