Setting up CDN on Sharepoint Online for use with Framework development

%3CLINGO-SUB%20id%3D%22lingo-sub-96997%22%20slang%3D%22en-US%22%3ESetting%20up%20CDN%20on%20Sharepoint%20Online%20for%20use%20with%20Framework%20development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-96997%22%20slang%3D%22en-US%22%3E%3CP%3Ethere%20is%20currently%20rather%20conflicting%20training%20advice%20for%20new%20SPFx%20developers.%20Can%20anyone%20confirm%20what%20is%20the%20correct%20guidance%20for%20this%20setup%20please%3F%20I%20have%20found%20these%20two%20completely%20different%20guidance%20docs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20%22General%20availability%20of%20Office%20365%20CDN%22%20Vesa%20Juvonen%20-%20Published%20April%2021%2C%202017%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdev.office.com%2Fblogs%2Fgeneral-availability-of-office-365-cdn%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.office.com%2Fblogs%2Fgeneral-availability-of-office-365-cdn%3C%2FA%3E%3CBR%20%2F%3Ethis%20proposes%20the%20command%20set%3C%2FP%3E%3CP%3ESet-SPOTenantCdnEnabled%20-CdnType%20Public%3CBR%20%2F%3EAdd-SPOTenantCdnOrigin%20-CdnType%20Public%20-OriginUrl%20%2Fsites%2Fsite%2Flibrary%3CBR%20%2F%3EGet-SPOTenantCdnOrigins%20-CdnType%20Public%3CBR%20%2F%3Eresulting%20in%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fpubliccdn.sharepointonline.com%2F%26lt%3Btenant%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpubliccdn.sharepointonline.com%2F%3CTENANT%3E%3C%2FTENANT%3E%3C%2FA%3E%20host%20name%26gt%3B%2Fsites%2Fsite%2Flibrary%3C%2FP%3E%3CP%3E%3D%3D%3D%3C%2FP%3E%3CP%3Ethen%20in%20the%26nbsp%3Blatest%20promoted%20developer%20training%20video%3CBR%20%2F%3EDeploying%20SharePoint%20Framework%20components%20to%20production%20-%20Deploying%20to%20SharePoint%20CDN%3C%2FP%3E%3CP%3Ethis%20proposes%26nbsp%3Ba%20different%26nbsp%3Bcommand%20set%20(earlier%3F)%3CBR%20%2F%3ESet-SPOTenant%20-PublicCdnEnabled%20%24true%3CBR%20%2F%3ENew-SPOPublicCdnOrigin%20Url%3A%20https%3A%2F%2F%3CTENANT%20host%3D%22%22%20name%3D%22%22%3E%2Fsites%2Fsite%2Flibrary%3CBR%20%2F%3EGet-SPOPublicCdnOrigins%3CBR%20%2F%3Eresulting%20in%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fpubliccdn.sharepointonline.com%2F%26lt%3Btenant%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpubliccdn.sharepointonline.com%2F%3CTENANT%3E%3C%2FTENANT%3E%3C%2FA%3E%20host%20name%26gt%3B%2F1544004027c884490c55638fcb53de1f5d4897c5ea7513c1c0849dd7d8f4314cbda99429%3C%2FTENANT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eboth%20command%20sets%20appear%20to%20run%20in%20the%20latest%20Sharepoint%20Online%20Command%20shell%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20all%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-98461%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20up%20CDN%20on%20Sharepoint%20Online%20for%20use%20with%20Framework%20development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-98461%22%20slang%3D%22en-US%22%3E%3CP%3Eyou%20are%20quite%20right%2C%20I%20have%20tried%20both%20methods%20now%20and%20the%20one%20that%20works%20is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-SPOService%20-Url%20https%3A%2F%2F%3CMY%20tenant%3D%22%22%20admin%3D%22%22%3E%3C%2FMY%3E%3C%2FP%3E%3CP%3EGet-SPOTenantCdnEnabled%20-CdnType%20Public%3C%2FP%3E%3CP%3EAdd-SPOTenantCdnOrigin%20-CdnType%20Public%20-OriginUrl%20sites%2Fspfxdev%2Fdevcdn%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethe%20CDN%20base%20path%20is%20then%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%3CFONT%20face%3D%22Consolas%22%3E%7B%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20face%3D%22Consolas%22%3E%3CSPAN%3E%22cdnBasePath%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22%3CA%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fpubliccdn.sharepointonline.com%2F%3CMYTENANTHOST%3E.sharepoint.com%2Fsites%2Fspfxdev%2Fdevcdn%2Fmyfolder%3C%2FMYTENANTHOST%3E%3C%2FA%3E%22%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CFONT%20face%3D%22Consolas%22%3E%7D%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eplease%20team%20could%20someone%20pull%20the%20old%20guidance%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-98412%22%20slang%3D%22en-US%22%3ERe%3A%20Setting%20up%20CDN%20on%20Sharepoint%20Online%20for%20use%20with%20Framework%20development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-98412%22%20slang%3D%22en-US%22%3EHi%20Kath%2C%3CBR%20%2F%3E%3CBR%20%2F%3Ethey%20did%20change%20how%20it%20was%20done%2C%20I%20have%20recently%20followed%20this%20article%20and%20works%20perfectly%20for%20me%3A%20%3CA%20href%3D%22https%3A%2F%2Fdev.office.com%2Fsharepoint%2Fdocs%2Fspfx%2Fweb-parts%2Fget-started%2Fhosting-webpart-from-office-365-cdn%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.office.com%2Fsharepoint%2Fdocs%2Fspfx%2Fweb-parts%2Fget-started%2Fhosting-webpart-from-office-365-cdn%3C%2FA%3E%3C%2FLINGO-BODY%3E
Contributor

there is currently rather conflicting training advice for new SPFx developers. Can anyone confirm what is the correct guidance for this setup please? I have found these two completely different guidance docs.

 

in "General availability of Office 365 CDN" Vesa Juvonen - Published April 21, 2017
https://dev.office.com/blogs/general-availability-of-office-365-cdn
this proposes the command set

Set-SPOTenantCdnEnabled -CdnType Public
Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl /sites/site/library
Get-SPOTenantCdnOrigins -CdnType Public
resulting in
https://publiccdn.sharepointonline.com/<tenant host name>/sites/site/library

===

then in the latest promoted developer training video
Deploying SharePoint Framework components to production - Deploying to SharePoint CDN

this proposes a different command set (earlier?)
Set-SPOTenant -PublicCdnEnabled $true
New-SPOPublicCdnOrigin Url: https://<tenant host name>/sites/site/library
Get-SPOPublicCdnOrigins
resulting in
https://publiccdn.sharepointonline.com/<tenant host name>/1544004027c884490c55638fcb53de1f5d4897c5ea7513c1c0849dd7d8f4314cbda99429

 

both command sets appear to run in the latest Sharepoint Online Command shell

 

thanks all

2 Replies
Hi Kath,

they did change how it was done, I have recently followed this article and works perfectly for me: https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/hosting-webpart-from-office-365-cd...

you are quite right, I have tried both methods now and the one that works is

 

Connect-SPOService -Url https://<my tenant admin>

Get-SPOTenantCdnEnabled -CdnType Public

Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/spfxdev/devcdn

 

the CDN base path is then

 

 

please team could someone pull the old guidance?