{"id":6061,"date":"2020-04-02T13:56:54","date_gmt":"2020-04-02T13:56:54","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6061"},"modified":"2020-04-02T13:56:54","modified_gmt":"2020-04-02T13:56:54","slug":"configure-spfx-webparts-to-azure-cdn","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/","title":{"rendered":"Configure SPFx Webparts to Azure CDN"},"content":{"rendered":"\n<p><em>In\nthis article, I have mentioned all steps on deploying SPFx webparts to Azure\nCDN. It requires some manual steps and some command\nto create the webparts.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/em><\/p>\n\n\n\n<p><em>SharePoint Framework has provided ootb supports for deploying\nto Azure Storage account. &nbsp;&nbsp;Please use Azure Storage account to\nmaintain the web parts.<\/em><\/p>\n\n\n\n<p><em>For\nthe Users who follow Microsoft\u2019s SharePoint framework, while building the SPFx webpart\nyou get your resource files i.e. CSS, JSON etc. You can deploy these resource files\n<\/em><em>on one of the below CDN:<\/em><strong><em><\/em><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>SharePoint Library in tenant<\/strong><\/li><li><strong>Office 365 Public CDN (Content Delivery Network)<\/strong><\/li><li><strong>Azure CDN (Content Delivery Network)<\/strong><\/li><\/ol>\n\n\n\n<p><em>Follow the below steps to deploy webpart in Azure CDN:<\/em><\/p>\n\n\n\n<p><strong>Create<\/strong> <strong>MS Azure Storage Account<\/strong><strong>:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Open MS Azure Portal&nbsp;(<\/em><a href=\"https:\/\/portal.azure.com\"><em>https:\/\/portal.azure.com<\/em><\/a><em>) in any browser and Login. <\/em><em><\/em><\/li><li><em>Click \u201cStorage accounts\u201d.<\/em><\/li><li><em>Click \u201c+Create\u201d and enter all the details for your storage account.<\/em><\/li><\/ol>\n\n\n\n<p><em>Check the following screen shot for all the\nsettings:<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1024x493.png\" alt=\"\" class=\"wp-image-6062\" width=\"541\" height=\"259\"\/><\/figure><\/div>\n\n\n\n<p><em>4. Fill all the details\ngiven below and click \u201cReview +Create\u201d.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/2.png\" alt=\"\" class=\"wp-image-6063\" width=\"526\" height=\"319\"\/><\/figure><\/div>\n\n\n\n<p><em>\u00a05. Go to the Resource.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/3-1024x475.png\" alt=\"\" class=\"wp-image-6064\" width=\"457\" height=\"212\"\/><\/figure><\/div>\n\n\n\n<p><strong>Create BLOB Container<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Click on \u201cContainers\u201d.<\/em><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/4.png\" alt=\"\" class=\"wp-image-6065\" width=\"500\" height=\"260\"\/><\/figure><\/div>\n\n\n\n<p><em>2. Select \u201c+ container\u201d<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/5-1024x310.png\" alt=\"\" class=\"wp-image-6066\" width=\"565\" height=\"171\"\/><\/figure><\/div>\n\n\n\n<p><em>3. Give the details and click \u201cok\u201d.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/6-1024x338.png\" alt=\"\" class=\"wp-image-6067\" width=\"527\" height=\"174\"\/><\/figure><\/div>\n\n\n\n<p><strong> Storage account access key: <\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Select <\/em>Access Keys<em>\u00a0in your Containers Settings.<\/em><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/7-1024x453.png\" alt=\"\" class=\"wp-image-6068\" width=\"633\" height=\"280\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/8-1024x469.png\" alt=\"\" class=\"wp-image-6069\" width=\"545\" height=\"249\"\/><\/figure><\/div>\n\n\n\n<p><em>2. Copy one of the access key from key1 or key2.<\/em><\/p>\n\n\n\n<p><strong>Enable CDN profile:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Under \u201cBlob Service\u201d, select \u201cAzure CDN\u201d.<\/em><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/9.png\" alt=\"\" class=\"wp-image-6070\" width=\"177\" height=\"222\"\/><\/figure><\/div>\n\n\n\n<p><em>2. Create a new endpoint and Click \u201cCreate\u201d<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/10.png\" alt=\"\" class=\"wp-image-6071\" width=\"549\" height=\"333\"\/><\/figure><\/div>\n\n\n\n<p><em>3. The endpoint list appears like this.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/11-1024x359.png\" alt=\"\" class=\"wp-image-6072\" width=\"585\" height=\"205\"\/><\/figure><\/div>\n\n\n\n<p>\u00a0\u00a0\u00a0<strong>Configure SPFx Solution: <\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Navigate to SPFx solution folder in command prompt<\/li><li>To open the webpart project in Visual Studio Code enter \u201ccode .\u201d <\/li><li>Open package-solution.json in the config folder.<\/li><li>Set \u201cincludeClientSideAssets\u201d value as false and \u201cskipFeaturedeployment\u201d value as true. <\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/12-1024x370.png\" alt=\"\" class=\"wp-image-6073\" width=\"590\" height=\"212\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li><em>To specify the Azure storage account details open deploy-azure-storage.json from config folder<\/em><\/li><li><em>Update values as below:<\/em><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/13.png\" alt=\"\" class=\"wp-image-6074\" width=\"562\" height=\"203\"\/><\/figure><\/div>\n\n\n\n<p><em>3. Open write-manifests.json from config folder and update the path<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/14-1024x294.png\" alt=\"\" class=\"wp-image-6075\" width=\"684\" height=\"195\"\/><\/figure><\/div>\n\n\n\n<p><strong>Prepare Solution to deploy:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>\u201cgulp bundle &#8211;ship\u201d run the command on command prompt . The ship switch denotes distribution.<\/em><\/li><li><em>\u201cgulp deploy-azure-storage\u201d  This commands deploy assets such as JavaScript and CSS files to the CDN.<\/em><\/li><li><em>\u201cgulp package-solution &#8211;ship\u201d this command create the solution package in the folder.<\/em><\/li><\/ol>\n\n\n\n<p><strong>Deploy package to SharePoint:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Open SharePoint app catalog, Upload or drag and drop the client-side solution package to the app catalog <\/em><\/li><li><em>Select on \u201cDeploy\u201d.<\/em><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1.png\" alt=\"\" class=\"wp-image-6076\" width=\"507\" height=\"191\"\/><\/figure><\/div>\n\n\n\n<p><em>3. Go to your \u201cSite contents\u201d and add your app.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/2-1.png\" alt=\"\" class=\"wp-image-6077\" width=\"290\" height=\"126\"\/><\/figure><\/div>\n\n\n\n<p><em>4. Edit page and select your webpart on your webpart picker.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/3-1.png\" alt=\"\" class=\"wp-image-6078\" width=\"369\" height=\"162\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/5-1-1024x263.png\" alt=\"\" class=\"wp-image-6079\" width=\"603\" height=\"154\"\/><\/figure><\/div>\n\n\n\n<p><strong><em>Summary:<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  Azure CDN is inexpensive and easy to configure. Azure CDN (Content Delivery Network) is a global cache option to deploy the SPFx client side webpart but always remember that CDN are public and cannot be secured, so the files shouldn't contain sensitive information.                       <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I have mentioned all steps on deploying SPFx webparts to Azure CDN. It requires some manual steps and some command to create the webparts.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SharePoint Framework has provided ootb supports for deploying to Azure Storage account. &nbsp;&nbsp;Please use Azure Storage account to maintain the web parts. For the Users who follow Microsoft\u2019s SharePoint framework, while building the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[],"class_list":["post-6061","post","type-post","status-publish","format-standard","hentry","category-office-365"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Configure SPFx Webparts to Azure CDN - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configure SPFx Webparts to Azure CDN - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this article, I have mentioned all steps on deploying SPFx webparts to Azure CDN. It requires some manual steps and some command to create the webparts.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SharePoint Framework has provided ootb supports for deploying to Azure Storage account. &nbsp;&nbsp;Please use Azure Storage account to maintain the web parts. For the Users who follow Microsoft\u2019s SharePoint framework, while building the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-02T13:56:54+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configure SPFx Webparts to Azure CDN - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/","og_locale":"en_US","og_type":"article","og_title":"Configure SPFx Webparts to Azure CDN - Softree Technology","og_description":"In this article, I have mentioned all steps on deploying SPFx webparts to Azure CDN. It requires some manual steps and some command to create the webparts.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SharePoint Framework has provided ootb supports for deploying to Azure Storage account. &nbsp;&nbsp;Please use Azure Storage account to maintain the web parts. For the Users who follow Microsoft\u2019s SharePoint framework, while building the [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/","og_site_name":"Softree Technology","article_published_time":"2020-04-02T13:56:54+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Configure SPFx Webparts to Azure CDN","datePublished":"2020-04-02T13:56:54+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/"},"wordCount":396,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1024x493.png","articleSection":["Office 365"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/","url":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/","name":"Configure SPFx Webparts to Azure CDN - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1024x493.png","datePublished":"2020-04-02T13:56:54+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#primaryimage","url":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1024x493.png","contentUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/04\/1-1024x493.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/office-365\/configure-spfx-webparts-to-azure-cdn\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Configure SPFx Webparts to Azure CDN"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=6061"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6061\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}