Back to Posts

WOFF files returns HTTP 404 in Azure Web Sites

Vincent Wesker in Azure

While deploying a website to Azure I noticed a lot of 404 errors suddenly. It seems like not al the font files where deployed.

404 Error on .woff file

But when I checked the fonts folder with Kudu I saw that all the fonts where deployed. And I was enabled to download them from Kudu. So it has to be something different.

Kudu font Folder

After some more investigation it turns out to be an Azure issue. Azure doesn't actually have a MIME type configured for WOFF files, so simply returns 404.

With a simple webConfig fix this can be fixed within seconds. Just add a few lines to the system.webServer section.

      <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" /> 

After these changes to the Web Config the woff and woff2 files where served again.

SharePoint O365 Dev | Azure | Working @ Mavention

Read Next

Azure website always on HTTPS