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

Error when creating sharepoint objects #78

Open
jb-365 opened this issue Mar 19, 2024 · 0 comments
Open

Error when creating sharepoint objects #78

jb-365 opened this issue Mar 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jb-365
Copy link

jb-365 commented Mar 19, 2024

Description

When I run the .deploy.ps the script encounters the following error:

powershell.exe Error: 0 : 2024-03-12 11:41:46.9536 [PnP.Framework] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

This is the command which is failing: Invoke-PnPSiteTemplate -Path (Join-Path $packageRootPath $templatePath) -ClearNavigation (Line 319)

The script succeeds doing the following things:

  1. Check for keyvaultname
  2. Create sharepointsite
  3. Login to AZ, azureAD, sharepointPNP, Microsoft graph

We also tried running the script using the serviceaccount specificed in the json parameter file for the sharepoint PNP login part of the script. (since this is the account which is specified in the json parameter file). We encountered the same results with this account.

Steps to reproduce

  1. Create the application using createazureadapp.ps1 (We changed the scope of the application to internal/this tenant only, since the intended user audience is internal members of our tenant).
  2. The account used has the following roles: Global admin, sharepoint admin, teams admin, subscription owner.
  3. The account used has the following permissions on the sharepoint site: site owner, owner, site admin
  4. The sharepoint site is placed under /sites
  5. These powershell modules are being used:

1.12.0 PnP.PowerShell
1.2.2.1 WriteAscii
5.8.0 MicrosoftTeams
7.8.4 ImportExcel
2.11.0 Microsoft.Graph
11.3.1 Az
2.0.2.183 AzureADPreview

Expected results

The deploy script does not complete. Stuck on create sharepoint items.

Actual Results

Error message described above.

Solution component

Deployment Script

Operating system (environment)

Windows

Additional Info

No response

@jb-365 jb-365 added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant