Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Office 365 Public CDN not working #2015

Closed
VesaJuvonen opened this issue Jun 12, 2018 · 19 comments

Comments

Projects
None yet
3 participants
@VesaJuvonen
Copy link
Contributor

commented Jun 12, 2018

From @harshdamaniahd on April 25, 2018 10:25

I have a site tenant.sharepoint.com
In this site in "SiteAssets" Library , I have created a folder called webpart where I am hosting all files from SPFX temp folder
here are my cdn defined.
Get-SPOPublicCDNOrigins
image

This is my cdn path : "cdnBasePath": "https://publiccdn.sharepointonline.com/tenantname.sharepoint.com/SiteAssets/Webpart/"

When i build and upload my webpart , I see the it is not able to get these files.
Can you pls tell me what I am missing

Copied from original issue: SharePoint/sp-dev-fx-webparts#491

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 25, 2018 10:39

Is there any reason why you are setting it all up manually, rather than having the SharePoint Framework package the scripts inside the .sppkg file and deploy them to the Office 365 CDN for you? This is by the way the default behavior, if you're using SharePoint Framework v1.4.1. Which version are you using?

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 25, 2018 12:42

Yes I am using v1. 4.1.. No specific reason.I was trying the approach of making document library as cdn

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 25, 2018 13:29

The challenge with doing it manually is, that in case the admin would turn off the Office 365 CDN, your web part wouldn't work anymore. When doing it automatically, SharePoint will automatically fallback to the document library URL when the CDN is disabled.

You could try to see if you could achieve the same result, by pointing to the document library URL rather than the CDN URL. Still, if you're deploying files to SharePoint, you could better follow the default behavior and have the SPFx toolchain include them in the package and have SharePoint deploy them automatically for you.

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 25, 2018 13:48

@waldekmastykarz actually i am pointing to document library but it is not working.
https://publiccdn.sharepointonline.com/tenantname.sharepoint.com/SiteAssets/Webpart/
This is my root site

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 25, 2018 18:20

You're using the Office 365 Public CDN URL: https://publiccdn.sharepointonline.com/.... Could you try using https://tenantname.sharepoint.com/SiteAssets/Webpart/ instead?

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 26, 2018 4:1

Normal document library works..But i was trying to make document library as cdn and it didnot work
I followed this article
https://blog.mastykarz.nl/publish-sharepoint-framework-client-side-web-parts-office-365-public-cdn/

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 26, 2018 6:48

@harshdamaniahd the steps outlined in my article were necessary in the past, when SharePoint didn't offer native support for deploying assets to the Office 365 CDN. Today however it does, so there is no true need to set it all up manually anymore.

Still, a manually setup CDN should work. Can you verify that your files stored in the webpart folder are accessible through the public CDN using the publiccdn.ashx handler as described in my article?

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 27, 2018 4:30

Yes they are accessible

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 27, 2018 17:29

What if you set https://tenantname.sharepoint.com/SiteAssets/Webpart/ as the base URL in your project: can you see SharePoint loading your web part files? If so, does it use the URL you specified or does it automatically replace it with the CDN URL?

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 28, 2018 14:4

Yes if i use https://tenantname.sharepoint.com/SiteAssets/Webpart/ as my baseurl , it loads file from the baseurl location.
It does not use cdn url .
Also i checked in postman and tried to fetch file from cdn it gives me the error
image

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @waldekmastykarz on April 28, 2018 17:47

This seems to be similar to #1731

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on April 29, 2018 3:43

I guess there is no solution as of now, the issue is tenant specific.

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on May 17, 2018 5:48

In my new tenant when i try to access json file from document library , i get the below error
image

CDN is enabled
image

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @hbgeorgian on May 17, 2018 9:14

The CDN is restricted to accept requests coming from SharePoint.com only. It won't work from postman unless you tweak the origin

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

From @harshdamaniahd on May 17, 2018 16:4

This is working for files with extension css,txt
image

but not with json it gives error "403 FORBIDDEN"

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

Since this seems to be a generic issue and NOT related on any sample in this repository, moving to the sp-dev-docs issue list at http://aka.ms/spdev-issues.

@OliverZeiser

This comment has been minimized.

Copy link

commented Jun 13, 2018

We are also seeing a tenant where the public CDN for ClientSideAssets is not working. Looking at the Developer Toolbar, the response from the CDN is 406 for GET and 405 for HEAD. Without CDN enabled, everything is working fine. Disabling CDN and enabling it again does not help. Removing Origins and adding them back again, does not help either... The same spfx package on other tenants works just fine..

@OliverZeiser

This comment has been minimized.

Copy link

commented Jun 13, 2018

To add some more info... On the Tenant where it is not working, the Content-Type is specified as application/json for javascript files, and on tenants where the cdn is working, the Content-Type is specified correctly as application/javascript

@andrewconnell

This comment has been minimized.

Copy link
Collaborator

commented Jan 16, 2019

This CDN issue has shown up a few times in different issues (#864, #1731, #3238)... consolidating to the most recent one with lots of detail, #3238, as this issue hasn't had much activity and a fix in late 2018 resolved issue for many reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.