We had a flow that when a file was created in a classic site SharePoint/SitePages it created a file with the same name and content in another classic site /SitePages. Everything was fine. We had a modern page in the classic site with the 'News' add-in and when news were created they were re-created in the other site.
Today I tried the same scenario, but instead of classic sites, I created two Communication sites. Now the flow gives an error when I try to create the file
"When a file is created in a folder" -> "Create File"
Error: "Acces Denied. you don't have permissions to perform this action or access to this resource"
The user is the primary administrator in both sites. Both created same way. Am I missing something here? I can't find any info about this.
I have made a test on my side and don't have the issue that you mentioned. My flow's configuration as below:
The flow works successfully as below:
The error message told that the account that you use to create a connection to the SharePoint connector doesn't have access to the Communication Site. Please check if the account that you use to create a connection to SharePoint connector has full access to the Communication Site.
In other words, please make sure the account that you create a connection to the SharePoint connector has Administrator permission on the two SharePoint Communication Sites.
In addition, please check if the connection to the SharePoint connector is invalid, if yes, please update the connection to the connector or re-create a new connection to the connector, then try your flow again to check if the issue is solved.
More detail about updating connections in Microsoft Flow, please check the following article:
Thank you for testing this,
In our case the user that we are using in both sites is the tennant administrator. Is the administrator of both SharePoint sites and it has access to both of them, we tried loging in and creating elements in both SitePage libraries, no problems at all.
I've tried deleting and recreating de Connections, creating new sites.. and the error persist.
I see that in your test you used /Shared Documents as the library, Could you perhaps try with /SitePages? I've been able to reproduce this error in other Office 365 tennants, but only with the SitePages library