Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get fontawesome to work on an Azure web pages deployment?

We are using Twitter Bootstrap and FontAwesome for icon support.

When deploying to one of our IIS servers I need to add MIME support.

When deploying to Azure, it doesn't look like I have this ability, so now my icons aren't showing up because it doesn't seem to know how to use the font.

like image 934
mattruma Avatar asked Nov 09 '12 13:11

mattruma


2 Answers

Just add the following to the web.config ...

<system.webServer>        <staticContent>        <remove fileExtension=".svg" />        <remove fileExtension=".eot" />        <remove fileExtension=".woff" />        <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />     </staticContent> </system.webServer> 
like image 113
Jamie Altizer Avatar answered Sep 20 '22 13:09

Jamie Altizer


UPDATE

This answer is now unnecessary due to recent changes in the FontAwesome nuget package.


In addition to the solution described in the accepted answer, I noticed that the fonts in my project were in ~/Content/fonts, but the site was looking for the fonts in /fonts on Azure.

As a workaround, I copied the font files to ~/fonts (making sure the Build Action was set to Content for all) and all is good in the cloud.

like image 29
Patrick McDonald Avatar answered Sep 23 '22 13:09

Patrick McDonald