Showing results for 
Search instead for 
Did you mean: 
Level 8

'Forbidden' Error Copying a file from SharePoint to On-Premises (using On-Premises Data Gateway)

I am trying to use the File System - Copy File action to move a file from SharePoint to an On-Premises File System.  Maybe some of you have seen a similar issue.


  • I have installed the On-Premises Data Gateway on my development machine (Windows 10 Pro)
    • I am logged in with my Azure AD account
    • I registerd this with the same account I have provided credentials for in the Flow 'Copy File' action
  • I am using a SharePoint action to get the Link of the file which I am copying


Flow Design


Error Trace


In the failure summary, I can see the details of the issue.  It tells me that the provided credentials don't have access to the target path.  This looks suspect to me - why does it switch the direction of the slashes before the file name? 




The outputs file is showing the following errors:

  • "body":{"status":403,"message":"403 FORBIDDEN\r\nclientRequestId:
  • Without further details

The local On-Premises Data Gatewaty logs showed this error:

Microsoft.Data.Mashup.MashupCredentialException (0x80004005): The credentials provided for the Folder source are invalid.


 I've troubleshot this (so far) by:

  • Looking at the Output logs provided by Flow
  • Reinstalling the OPDG (more than once)
  • Reconfiguring the OPDG connection on the Flow action  (more than once)
  • Reviewing the local Flow logs on the target machine.


Has anyone encountered issues similar to this? 

Level 8

Re: 'Forbidden' Error Copying a file from SharePoint to On-Premises (using On-Premises Data Gateway)

In Flow, when working with File System actions, you need to create a connector to your On-Premises Data Gateway.  Here is the screen. 


Configuring the Flow On-Premises Data Gateway Connector.png


In the fields for Username and Passowrd, you have to put the credentials in the domain\login pattern.  I was failing when I entered the credentials as  After recreating the connection using these credentials, I was able to connect using the On-Premises Data Gateway. 


Also - you can use the PowerShell command below to return the logged on domain and user: 



After making this change, I was able to use the File System - Create File action successfully, but not the File System - Copy File action. 

Community Support Team
Community Support Team

Re: 'Forbidden' Error Copying a file from SharePoint to On-Premises (using On-Premises Data Gateway)

Hi @panterra,


Could you please share a screenshot of your flow’s configuration?

The issue is confirmed on my side. I think the File System connector have no access to the file in SharePoint with “Link to item” content. Only the people who are assigned with proper access could access the file in SharePoint.


Besides, if you want to copy file from SharePoint to local folder, please take a try with the alternative way as below:17.JPGThe flow works successfully as below:18.JPG


Best regards,


Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: 'Forbidden' Error Copying a file from SharePoint to On-Premises (using On-Premises Data Gateway)

I had the same Forbidden error and this solution worked for new files saved to the folder or e.g. right click -> New - Text Document, but failed for files pasted into the folder.

Helpful resources


Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.


Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020


Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Microsoft Learn

Learn how to build the business apps that you need


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 49 members 4,350 guests
Please welcome our newest community members: