Don't get caught out by Office 365 CDN settings

Quick note on something that caught me out today. Suppose you've developed your SPFx solution, you've tested it on developer tenancies, and you're ready to push it out on your client's Office 365 tenancy. You drop it into the App Catalog, and you see the following:

Well that's not good. It's enabled... it's a valid app package... but it's failed to deploy. In the App Package Error Message column, we've got a generic Deployment failed. Correlation ID... message that doesn't shed much light on the situation.

This turned out to be a simple oversight in Office 365 CDN settings. If  you're bundling client-side assets into your sppkg file (as is the default from SFPx 1.4 onwards), rather than deploying them to a separate CDN, you must make sure the public CDN is enabled on your Office 365 tenancy. It's a requirement that's well-covered in the SPFx documentation, but it might not be the first thing that comes to mind when you see a generic deployment error.

In other words, if your package-solution.json file includes this:

"includeClientSideAssets": true

You'll need to run something like this in PowerShell:

Set-SPOTenantCdnEnabled -CdnType Public -Enable $true

Hope that saves someone some head-scratching.


Popular posts from this blog

The target principal name is incorrect. Cannot generate SSPI context.

Server-side activities have been updated

Versioning SharePoint Framework Packages