Azure App Service, Development

How to serve WOFF fonts from Azure App Service

How to serve WOFF fonts from Azure App Service.

Solution:

1. Locate or create web.config

If you have asp.net application you will find the web.config but if you have hosted any other distrubution such as wordpress you can still create the web.config if this is not presented already.

2. Include/merge below code in web.config


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

How to do it:

Go to Azure portal -> Locate your App Service -> Under Development Tools click on Advanced Tools -> click on Go link

How to serve woff font files from Azure App Service

A new tab will be opened and you will see Kudu logo, select Debug console and then CMD

Kudu click on cmd - How to serve woff font files from Azure App Service .png

Now navigate to the D:homesitewwwroot and find the web.config, if you find it then merge the code, else create it and copy paste the code mentioned in step 2.

In fact you can put any file extension you want to serve Azure App Service to serve as static file.

Merge web.config entreies - How to serve woff font files from Azure App Service.png

For more Details