Had an issue over the past few weeks where I couldn’t swap out the root sharepoint site with a different site.
In the Office365 gui the error I got was
Couldn’t replace root site …/sites/team Wait 10 minutes, and then try again
And in Powershell
> Invoke-SPOSiteSwap -SourceUrl https://XXXXX.sharepoint.com/sites/Team -TargetUrl https://XXXXX.sharepoint.com -ArchiveUrl https://XXXXX.sharepoint.com/sites/CommsArchive
Invoke-SPOSiteSwap : The operation is blocked due to maintenance. Please try again later
There’s a known issue that you need to enable the Office365 private CDN for this to work. Command is below:
> Set-SPOTenantCdnEnabled -CdnType Private -Enable $true
WARNING: Enabling this feature will turn on a content delivery network (CDN) for this tenant to provide fast and
reliable performance for shared assets. The CDN may have privacy and compliance standards that differ from the
commitments and compliance boundaries outlined by the Microsoft Office365 Trust Center, and data cached through this
service may not conform to the Microsoft Data Processing Terms (DPT). For more information on CDNs,
see:https://go.microsoft.com/fwlink/?linkid=2077392
Confirm
Are you sure you want to perform this action?
Performing the operation “Enable Tenant CDN” on target “Private CDN”.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”): y
WARNING: Files of type GIF,ICO,JPEG,JPG,JS,PNG,GLB stored in the locations configured to serve as Private CDN origins
will now also be served and cached in Content Delivery Network (CDN). Although only authenticated users are authorized
to access such content, the CDN is not monitored nor governed by Microsoft content policies.
After this, the site swap process just work