The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect. #3500
Unanswered
faisaleem-na
asked this question in
Q&A
Replies: 1 comment
-
Try and add -ValidateConnection parameter (added in 1.12 or so) to Connect-PnPOnline to get an error. Without that it will not always throw any kind of error |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussed in #2465
Originally posted by ItsTerryDuckett October 14, 2022
I have an Azure Runbook with a system managed identity. I'm using the following code as a simple test:
The "Connect-PnPOnline -ManagedIdentity" works fine and connects. However, the next line, "$list = Get-PnPList -Identity "listid" -Connection $conn" returns the following error:
"The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect."
If I switch the runbook back to using a "runas" account, it works fine.
If I try and use "Connect-PnPOnline -ManagedIdentity -Url $url" the above error occurs
Beta Was this translation helpful? Give feedback.
All reactions