pnp / pnp/pnpframework

Invoke-PnPTenantTemplate runs into timeout error when authentication via ClientId and Certificate

Open
#829 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

Issue

While calling Invoke-PnPTenantTemplate, my provisioning routine always runs into a timeout error.

I'm trying to create a new Team via a tenant template in App-only context (AuthN via self registered Azure AD and certificate). After a few minutes, the provisioning process get stuck and always fails with the following three errors:

image

[1]: Teamifying site at URL - https://{myTenant}.sharepoint.com/sites/TEST-6ff9e109-74b9-4f2f-b5ae-86b0262a93a5 failed due to an exception:- Exception while invoking endpoint https://graph.microsoft.com/v1.0/groups/d0a167e1-8f5f-47b4-8641-90f49117bcb7/team.

This is a common error – so nothing special to me.

[2]: Teamifying prompt couldn't be hidden at site at URL - https://{myTenant}.sharepoint.com/sites/TEST-6ff9e109-74b9-4f2f-b5ae-86b0262a93a5 in App-only context

[3]: Team with id d0a167e1-8f5f-47b4-8641-90f49117bcb7 not created within timeout.

This error occurs after a while

The whole provisioning process runs like a charm while authenticating as user (with user credential).

Process

I'm trying to connect and provision this way:

try {
  $connAdmin = Connect-PnPOnline -Url "https://{myTenant}-admin.sharepoint.com/" -ClientId $clientId -Tenant $tenant -CertificateBase64Encoded $secret -ReturnConnection
  $newSiteCollection = Invoke-PnPTenantTemplate -Template $provisioningTemplate -Parameters $pnpParameters -Connection $connAdmin -Verbose -ErrorAction $ErrorActionPreference
} catch {
  Write-Warning "Error while connecting or invoking template"
  throw $PSItem
}

Any clue, @PaoloPia? Would you help me investigate why the provisioning process always get stuck and fails with a timeout?
Thanks a lot and many greetings, Tobias

version of the PnP module

PnP.Powershell 1.9.0 (PowerShell 5.1)

operating system / environment running PnP PowerShell

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Azure Automation

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Connect-PnPOnline and Invoke-PnPTenantTemplate calls in the reported Azure Automation setup, comparing certificate-based app-only authentication with the working user-authenticated process. Reproduce the tenant-template run and inspect the Microsoft Graph team endpoint and timeout errors. Done means the template creates the Team and completes without the app-only timeout or related failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
authentication, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.