Forum Discussion
How do we deploy SPFx Web Parts to a Private CDN on O365?
- May 16, 2017
You cannot deploy SPFx solutions using private CDN at least currently. This is due the fact that the private CDN URL is changing and is not static, which is needed, so that you can define web part host URL in the web part manifest.
Few pointers
- Client-side web part JS files only contain JS script - not secrets or actual information, so there should not be any concerns from that perspective around hosting them from public CDN
- If you still would like to get them hosted from fully secured URL, you'd use simply directly for example library in SharePoint without any CDN capabilities and you'd update the manifest URLs to point to that one
Hopefully that clarifies the situation.
Tried a different approach, setting the cdnbasepath to a relative URL that points to the private origin folder. The web part now shows up and operates as expected, but inspection with an F12 in the browser shows that the web part is coming directly from the SPO document library and not from the CDN.
Is it possible to have a definitive answer about whether this will work or not? Can we host SPFx web part files in a PRIVATE CDN? Is it something that is coming? Or is it never intended to work this way, with the expectation that all SPFx web parts will use a PUBLIC CDN?
The direction of my development on this current project depends on the answer. Help me Vesa-wan Kenobi, you're my only hope!
- Robin GüldenpfennigMay 16, 2017Brass Contributor
I'm also interested in an answer to that, Waldek Mastykarz VesaJuvonen