Sharepoint / DownloadZip action error

Error: SharePoint Site Address 'https://uksouth1-mediap.svc.ms/' is not valid clientRequestId: xxxx-xxxx-xxxx-xxxx-xxxxx.
With a recent update to power automate, Microsoft seems to introduce a new validation, which blocks the creation of a ZIP file using Sharepoint.
The method described by Paul in the following article: https://tachytelic.net/2021/07/power-automate-create-zip-file/

It seems like the issue is related to the recently introduced new validation for "Send an HTTP request to SharePoint" action by Microsoft. it is now in first place validating that the URL used is a valid SharePoint URL. As mentioned in the error URL is not a valid SharePoint URL site, it is a service URL, which is used to make transformations. Therefore the step is failing.

UPD: Per the docs, the ‘Send a HTTP request to SharePoint’ action of the SharePoint connector supports only SharePoint REST APIs and this has recently been enforced.  The doc recommends to use the “HTTP with Microsoft Entra ID" connector for accessing Microsoft services other than SharePoint.

The solution is to replace the DownloadZip action step (type: "Send an HTTP request to SharePoint") to the usual HTTP request step (or with "HTTP with Microsoft Entra ID") with the same parameters, which you can copy from the existing DownloadZip step:

HTTP DownloadZip action step code:
{
  "type": "Http",
  "inputs": {
    "uri": "@{body('SharePointHTTP')['ListSchema']['.mediaBaseUrl']}/transform/zip?cs=@{body('SharePointHTTP')['ListSchema']['.callerStack']}",
    "method": "POST",
    "headers": {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    "body": "zipFileName=test.zip&guid=@{guid()}&provider=spo&files=@{encodeUriComponent(outputs('Attachment_Items'))}&oAuthToken="
  },
  "runAfter": {
    "Attachment_Items": [
      "Succeeded"
    ]
  },
  "runtimeConfiguration": {
    "contentTransfer": {
      "transferMode": "Chunked"
    }
  }
}


You can also retain the existing action step and set the condition to run it only if the usual HTTP action fails:





 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.

Blog Tags