FlowPowerAppsMigrator icon indicating copy to clipboard operation
FlowPowerAppsMigrator copied to clipboard

Error : Apply-PnPProvisioningTemplate : Access is denied.

Open ghazalsrs opened this issue 3 years ago • 7 comments

Apply-PnPProvisioningTemplate : Access is denied. I get this error image

user has full control access on the site

ghazalsrs avatar Sep 28 '22 00:09 ghazalsrs

Hi @ghazalsrs,

Can you, please confirm you are a site collection administrator on the /sites/SP-UAT site?

Zerg00s avatar Sep 28 '22 01:09 Zerg00s

@ghazalsrs , can you, please share the Lists.xml file from the script folder? I can try running it against my test tenant to see if there is something wrong with the site template.

Zerg00s avatar Sep 28 '22 03:09 Zerg00s

hi there, I set that account as site owner not SCA

ghazalsrs avatar Sep 28 '22 05:09 ghazalsrs

Hi @ghazalsrs. do you still experience an issue? Did setting up SCA fix this issue?

Zerg00s avatar Sep 28 '22 13:09 Zerg00s

Hi @Zerg00s, @ghazalsrs,

I had the same problem but I think I found my issue which is related to the language which was used while creating the destination sitecollection. Could it be that you, @ghazalsrs, have the same issue?

Try creating the destination sitecollection based on the same language you used to ceate the source sitecollection. Some languages use 'Id' in SharePoint lists where others use 'ID'. I created a Dutch destination sitecollection which uses 'ID' but found out that my source sitecollection was created with the English language which uses 'Id'.

After creating the sitecollection with the English language the script executed successfully.

SharePointSite_language

QJappie22 avatar Sep 30 '22 12:09 QJappie22

@QJappie22

Thank you! I think you are right. I just tried migrating lists from an English to a Dutch site. image

As a result, I am also getting the 0x80070005 (E_ACCESSDENIED) error image

Zerg00s avatar Sep 30 '22 14:09 Zerg00s

For now, I've added a message that will help people explain that the error occurs because of the language mis-match between the source and the targe sites:

image

But Ideally, I need to figure out if there is a better workaround. Not sure if it's going to be do-able because I am using the PnP PowerShell module

Zerg00s avatar Sep 30 '22 14:09 Zerg00s