<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure web app &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/azure-web-app/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 14 Aug 2020 09:51:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Azure web app &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Azure CDN with Azure Web App &#8211; Access to Font at CDN has been Blocked by CORS Policy</title>
		<link>https://sibeeshpassion.com/azure-cdn-with-azure-web-app-access-to-font-at-cdn-has-been-blocked-by-cors-policy/</link>
					<comments>https://sibeeshpassion.com/azure-cdn-with-azure-web-app-access-to-font-at-cdn-has-been-blocked-by-cors-policy/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 14 Aug 2020 09:36:34 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure CDN]]></category>
		<category><![CDATA[Azure CDN WordPress CORS issue]]></category>
		<category><![CDATA[Azure CORS issue]]></category>
		<category><![CDATA[Azure web app]]></category>
		<category><![CDATA[CORS]]></category>
		<category><![CDATA[CORS with Azure CDN]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14177</guid>

					<description><![CDATA[[toc] Introduction Working with Azure web app is always fun. I was facing a CORS issue in my WordPress web application recently. Here in this post, I am going to share with you the solution that helped me. I was using Azure CDN to serve all my files and all the files were loading fine except the fonts and icons because I was getting the CORS issue. Here is the fix. Preceding is the image of my browser console, where you can see the error clearly. Here is how my blog looked like when the icons were not loading. Fix [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>Working with Azure web app is always fun. I was facing a CORS issue in my WordPress web application recently. Here in this post, I am going to share with you the solution that helped me. I was using Azure CDN to serve all my files and all the files were loading fine except the fonts and icons because I was getting the CORS issue. Here is the fix. Preceding is the image of my browser console, where you can see the error clearly.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="491" src="/wp-content/uploads/2020/08/CORS-error-in-broswser-console-1024x491.png" alt="" class="wp-image-14178" srcset="/wp-content/uploads/2020/08/CORS-error-in-broswser-console-1024x491.png 1024w, /wp-content/uploads/2020/08/CORS-error-in-broswser-console-300x144.png 300w, /wp-content/uploads/2020/08/CORS-error-in-broswser-console-768x368.png 768w, /wp-content/uploads/2020/08/CORS-error-in-broswser-console-425x204.png 425w, /wp-content/uploads/2020/08/CORS-error-in-broswser-console.png 1064w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>CORS issue</figcaption></figure>



<p>Here is how my blog looked like when the icons were not loading.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="785" height="258" src="/wp-content/uploads/2020/08/Missing-icons.png" alt="" class="wp-image-14181" srcset="/wp-content/uploads/2020/08/Missing-icons.png 785w, /wp-content/uploads/2020/08/Missing-icons-300x99.png 300w, /wp-content/uploads/2020/08/Missing-icons-768x252.png 768w, /wp-content/uploads/2020/08/Missing-icons-425x140.png 425w" sizes="(max-width: 785px) 100vw, 785px" /><figcaption>Missing icons</figcaption></figure>



<h2 class="wp-block-heading">Fix for &#8220;Acces to font CROS policy issue&#8221;</h2>



<p>The first thing to do is to allow requests from all the origins, we can easily do this in Azure web application. Just login to your Azure portal, and go to your Azure web application. Click on the CORS menu under API and * as the allowed origin. </p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="848" src="/wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app-1024x848.png" alt="" class="wp-image-14179" srcset="/wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app-1024x848.png 1024w, /wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app-300x249.png 300w, /wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app-768x636.png 768w, /wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app-425x352.png 425w, /wp-content/uploads/2020/08/Allow-origins-in-Azure-web-app.png 1137w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Allow origins in Azure web app</figcaption></figure>



<p>When you are done, just click on the Save button. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>By default files with .woff2, .woff, and .ttf extensions are not served by IIS in Azure App Service.</p><cite>Azure app service IIS config</cite></blockquote>



<p>Now we should edit our web.config file with the configuration for these files. The web.config file will be present in the root folder where your index file is. You can use windows explorer to FTP to get this file or use FTP clients such as FileZilla or use the deployment tool Kudu in the Azure portal.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="924" height="393" src="/wp-content/uploads/2020/08/Web.config-in-KUDU.png" alt="" class="wp-image-14180" srcset="/wp-content/uploads/2020/08/Web.config-in-KUDU.png 924w, /wp-content/uploads/2020/08/Web.config-in-KUDU-300x128.png 300w, /wp-content/uploads/2020/08/Web.config-in-KUDU-768x327.png 768w, /wp-content/uploads/2020/08/Web.config-in-KUDU-425x181.png 425w" sizes="(max-width: 924px) 100vw, 924px" /></figure>



<p> There should be separate configuration entries for each font file types. We will add these configurations in the system.webServer tag which is the child tag of configuration tag. </p>



<script src="https://gist.github.com/SibeeshVenu/a4bc9422db0ba1be7423b97beabf330d.js"></script>



<p>You can also do this by adding the extension called &#8220;Enable Static Web Fonts&#8221;. To add an extension, click on the Extensions menu from the left pan and then click on +Add.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="893" height="401" src="/wp-content/uploads/2020/08/Add-extension-in-Azure-app.png" alt="" class="wp-image-14182" srcset="/wp-content/uploads/2020/08/Add-extension-in-Azure-app.png 893w, /wp-content/uploads/2020/08/Add-extension-in-Azure-app-300x135.png 300w, /wp-content/uploads/2020/08/Add-extension-in-Azure-app-768x345.png 768w, /wp-content/uploads/2020/08/Add-extension-in-Azure-app-420x190.png 420w, /wp-content/uploads/2020/08/Add-extension-in-Azure-app-425x191.png 425w" sizes="(max-width: 893px) 100vw, 893px" /><figcaption>Add extension in Azure app</figcaption></figure>



<p>Now click on the &#8220;Choose extension&#8221; option and select the &#8220;Enable Static Web Fonts&#8221; extension.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1023" height="381" src="/wp-content/uploads/2020/08/Enable-static-web-fonts-extension.png" alt="" class="wp-image-14183" srcset="/wp-content/uploads/2020/08/Enable-static-web-fonts-extension.png 1023w, /wp-content/uploads/2020/08/Enable-static-web-fonts-extension-300x112.png 300w, /wp-content/uploads/2020/08/Enable-static-web-fonts-extension-768x286.png 768w, /wp-content/uploads/2020/08/Enable-static-web-fonts-extension-425x158.png 425w" sizes="(max-width: 1023px) 100vw, 1023px" /><figcaption>Enable static web fonts extension</figcaption></figure>



<p>Now accept the legal terms and click OK.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>When you are done configuring, just visit your azure web application, you should now see that all the fonts, icons are loaded.</p>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/azure-cdn-with-azure-web-app-access-to-font-at-cdn-has-been-blocked-by-cors-policy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
