angularazurestatic-contentwoff

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?


Solution

  • 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>