Facing issue while uploading file at SharePoint using Rest APIs in ADF

Contributor

Hi,

 

We would like to upload file at SharePoint using Azure Data Factory (ADF). We found that we can call below SharePoint Rest API to upload file but it's not working as expected for us.

 

https://[INSTANCE_NAME].sharepoint.com/[SITE_NAME]/_api/web/GetFolderByServerRelativeUrl(%27/[SITE_NAME]/[FOLDER_NAME]%27)/Files/add(url='fileName.png',overwrite=true)

 

We are able to upload file successfully but, when open the file, it's not working as expected. We have tried .txt and .jpg files. When open .txt file, we can see binary string as text in file instead of actual content. For the image file, we cannot see actual image file, instead we are getting error. 

 

We have used ADF, Power Automate Flow (HTTP Step/action) and Postman to call Rest API.

 

> Is there any alternative way to upload file at SharePoint using ADF other than Rest APIs? 

> Is there any alternative SharePoint Rest API to upload file?

 

Any help will be appreciated.

 

Thank you

0 Replies