import Global from '../../_global.mdx';
Enable or disable the specified Microsoft 365 CDN
m365 spo cdn set [options]`-e, --enabled <enabled>`
: Set to true to enable CDN or to false to disable it. Allowed values: `true`, `false`.
`-t, --type [type]`
: Type of CDN to update. Allowed values: `Public`, `Private`, `Both`. Defaults to `Public`.
`--noDefaultOrigins`
: Specify this flag to not create the default origins.Using the -t, --type option you can choose whether you want to manage the settings of the Public (default), Private CDN or both. If you don't use the option, the command will use the Public CDN.
Using the -e, --enabled option you can specify whether the given CDN type should be enabled or disabled. Use true to enable the specified CDN and false to disable it.
Using the --noDefaultOrigins option you can specify to skip the creation of the default origins.
:::info
To use this command you must be a Global or SharePoint administrator.
:::
Enable the Microsoft 365 Public CDN on the current tenant
m365 spo cdn set --type Public --enabled trueDisable the Microsoft 365 Public CDN on the current tenant
m365 spo cdn set --type Public --enabled falseEnable the Microsoft 365 Private CDN on the current tenant
m365 spo cdn set --type Private --enabled trueEnable the Microsoft 365 Private and Public CDN on the current tenant with default origins
m365 spo cdn set --type Both --enabled trueEnable the Microsoft 365 Private and Public CDN on the current tenant without default origins
m365 spo cdn set --type Both --enabled true --noDefaultOriginsThe command won't return a response on success.
- Use Microsoft 365 CDN with SharePoint Online: https://learn.microsoft.com/microsoft-365/enterprise/use-microsoft-365-cdn-with-spo?view=o365-worldwide