Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose and serve WOFF file from Azure without web.config?

I'm serving a static site (really Angular but all the bundles are static as well as the index-html) in Azure. It works as supposed to except a single thing. For some reason the WOFF files aren't being exposed properly.

The solution for it as far my google-foo goes is to edit the web.config in a way similar to this blog or this one and a similar suggestions are all over the place.

Here's the tricky part: I don't have a config in my deployment. It's just a bunch of files (a few HTMLs, JSs and CSSs - and the darn WOFF). How can I make Azure application serve all static content, including WOFFs?

like image 205
Konrad Viltersten Avatar asked Aug 15 '17 19:08

Konrad Viltersten


2 Answers

I don't have a config in my deployment

You can just add a web.config file at the root folder of your app with the following contents.

<configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff2" /> 
    </staticContent>
  </system.webServer>
</configuration>
like image 183
itaysk Avatar answered Nov 12 '22 04:11

itaysk


You can install an extension for your Azure App Service:

https://github.com/johnnyqian/enable-font-awesome-site-extension

like image 2
Johnny Qian Avatar answered Nov 12 '22 06:11

Johnny Qian