0

How do I publish a Font Awesome library to a Azure Web App service?

I'm using Visual Studio 2019 and .NET Framework 4.8

Either the library is not getting published, or it is not accessible.

I get an error in the browser console:

"downloadable font: download failed (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:1): status=2147746065 source: <my-url>/fontawesome513/webfonts/fa-solid-900.woff2"

This question has basically been asked here. However, the accepted answer seems to be flawed and out-of-date. See my reasoning at the bottom of this post.

Does the custom font limitation for PDF generation (mentioned in the other post's answer) apply to web apps, in general?

If not, any insight into how to publish a font to an Azure Web App?

It seems hard to believe that publishing and using font libraries is not allowed for a Web App on Azure.

Reasoning for creating this question: The accepted answer points to a specific process of PDF generation: "Known issue for all PDF generators based on wkhtmltopdf or phantomjs: custom fonts are not rendered..." (source: Azure Web App sandbox, at the bottom of the page). The answer's "custom font" link redirects to non-custom-font tutorial and the "feeback post" link gives a "Page Not Found" error.

In light of this, it seems that an update to the existing question needs to occur, or a new question submitted. Thus this question (and I don't have enough rep to post a comment in the other question).

1 Answers1

0
  • Make sure the Build Action property is set to Content for font all the files.
  • Since we don't have access to IIS Manager for an Azure web app,add the below snippet in web.config

If you do not have a web.config file create one.

<system.webServer>
    <staticContent>
        <remove fileExtension=".svg" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <remove fileExtension=".eot" />
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <remove fileExtension=".woff" />
        <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
        <remove fileExtension=".woff2" />
        <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
    </staticContent>
</system.webServer>
  • Make sure web.config is deployed and is under root directory after deployment.
Harshitha Veeramalla
  • 1,515
  • 2
  • 10
  • 11
  • Thanks for the feedback. The file's Build Action is set to Content. I added the lines to the web.config file. I've confirmed the web.config file is being deployed to the root directory. I also confirmed that the font files in question have been deployed to the web app service. Also, the error related to the files: > GET http:///fontawesome513/webfonts/fa-solid-900.woff2 [HTTP/1.1 404 Not Found 49ms] – NappyCoder Feb 25 '22 at 18:33