Is there any way to send rest request to enable SharePoint Public CDN ?

Aaditya Rane 51 Reputation points
2021-10-26T10:46:54.573+00:00

In order to enable Public CDN, there are ways given using "SharePoint PowerShell" and using "m365 cli".

When I looked the request using fiddler in case of "SharePoint PowerShell" and using inbuild debug feature in "m365 cli", I have seen POST request is getting send as follows...

POST https://secloredev-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery
Content-type: application/xml

<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="CLI for Microsoft 365 v3.13.0" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
    <Actions>
        <ObjectPath Id="19" ObjectPathId="18" />
        <Method Name="SetTenantCdnEnabled" Id="20" ObjectPathId="18">
            <Parameters>
                <Parameter Type="Enum">0</Parameter>
                <Parameter Type="Boolean">true</Parameter>
            </Parameters>
        </Method>
        <Method Name="CreateTenantCdnDefaultOrigins" Id="21" ObjectPathId="18">
            <Parameters>    
                <Parameter Type="Enum">0</Parameter>
            </Parameters>
        </Method>
    </Actions>
    <ObjectPaths>
        <Constructor Id="18" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
    </ObjectPaths>
</Request>

Is there any documentation or reference available for above format, specially "TypeId".

Or is there, any other way by which I can enable public CDN using user's delegated permissioned "Auth Token" only, without going through all login flow of "PowerShell" or "M365 CLI" ?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 31,071 Reputation points Microsoft Vendor
    2021-10-27T08:32:55.85+00:00

    Hi @Aaditya Rane ,
    Per my research, there is no such function to enable CDN with "Auth Token" only. You can refer to the following document to enable CDN.
    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/enable-microsoft-365-content-delivery-network?tabs=msposh


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 additional answers

Sort by: Most helpful