Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply-PnPProvisioningTemplate : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) #53

Open
yusufshaikh22 opened this issue Jun 11, 2023 · 2 comments

Comments

@yusufshaikh22
Copy link

Hi @Zerg00s,
While Importing existing list & libraries in target sit gives an error.

image

[Attention] Look for a login popup in a separate window. Please, log in to the source site site https://04xd3.sharepoint.com/sites/Federal Connected to the source site Site: https://04xd3.sharepoint.com/sites/Federal
User: Firdos Shaikh (FirdosShaikh@04xd3.onmicrosoft.com)
Mapping file resourceMapping.csv is generated
C:\Users\YusufShaikh\Downloads\FlowPowerAppsMigrator
Exporting lists and libraries...
[Attention] Look for a login popup in a separate window. Please, log in to the target site https://t1jtk.sharepoint.com/sites/Federal.

Connected to the target site
Site: https://t1jtk.sharepoint.com/sites/Federal
User: Harsh Markad (ABC@t1jtk.onmicrosoft.com)
Applying PnP Template to https://t1jtk.sharepoint.com/sites/Federal
C:\Users\YusufShaikh\Downloads\FlowPowerAppsMigrator
Importing lists and libraries...
[Error] Make sure that both target site and the source sites created with the same language. Cross-language list migration is not supported.
Apply-PnPProvisioningTemplate : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At C:\Users\YusufShaikh\Downloads\FlowPowerAppsMigrator\MISC\Move-Lists.ps1:124 char:9

  •     Apply-PnPProvisioningTemplate -Path Lists.xml
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerUnauthorizedAccessException
    • FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate
      Press any key to continue . . .

But i have created one new list in same source site & import to same target site its exported successfully.

@Zerg00s
Copy link
Owner

Zerg00s commented Jun 11, 2023

Hi @yusufshaikh22 I assume that ABC@t1jtk.onmicrosoft.com has Full Control at the https://t1jtk.sharepoint.com/sites/Federal site?

In this case, it might be an issue that is difficult to troubleshoot. Would you be able to create 2 SharePoint-only app registration?

  • For the source tenant
  • For the target tenant

How to Register an App-only permissions app

image

  • Get Client ID and Client Secret (on the next screen). Store them in a safe place

image

<AppPermissionRequests AllowAppOnlyPolicy="true">
  <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
  <AppPermissionRequest Scope="http://sharepoint/taxonomy" Right="Write" />
</AppPermissionRequests>

image

image

Then you can fill out the config\migrator-config.json file with the required information and run the migratory again.

@Zerg00s
Copy link
Owner

Zerg00s commented Jul 6, 2023

Update: some site columns cause this issue

I have published a new release, in which I automatically remove several pesky site columns causing the Access Denied error.

For now, I remove only these two fields:

  • TriggerFlowInfo
  • IsolatedDomain

But I suspect more fields are causing this error. I will attempt to hunt down more of them and include them in future releases. If anyone gets the Access denied error, please, share the Lists.xml file with me so I can debug it and see which fields are responsible for this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants