Connect-PnPOnline Fails w/ PS 7.2 & PnP 2.1.1 in Azure Runbook #3779
Replies: 9 comments
-
The same issue here. Any updates yet? |
Beta Was this translation helpful? Give feedback.
-
Same here - Azure runtime version 7.2 (preview), it can't find the certificate - in my case the certificate is tied to an Azure App for the authentication - I assume @BlazeOfFeathers and @dremillard are using the same model like me to connect to SharePoint Online through an Azure App - is this still the model or should I use something else? "Cannot find certificate with this thumbprint in the certificate store." |
Beta Was this translation helpful? Give feedback.
-
Have a similar problem, only the error message is slightly different "ERROR! Keyset does not exist". |
Beta Was this translation helpful? Give feedback.
-
I have found a solution for this issue. You need to migrate your runbooks to managed identities.
Instead of using an App Registration, you need to grant permissions to your Runbook through a managed identity. |
Beta Was this translation helpful? Give feedback.
-
Has anyone found a way to authenticate using a certificate in an azure automation runbook (powershell 7.2)? |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure I've had this working with PnP Posh 2.x in Azure Runbooks with certs as well as a managed identity using sites.selected. Would need to see if I still have the examples as I've lost quite a bit of Azure components recently, but it was pretty straightforward from what I remember. What's the issue you're running into trying to use sites.selected @bckrma ? |
Beta Was this translation helpful? Give feedback.
-
Ah okay, i thought it was a general problem with the Sites.Selected permission. My steps
The results of my testing runbook: PnP.PowerShell - Managed Identity
Output
PnP.Powershell - Access Token
Output
Graph - SDK
Output
Graph - Invoke-RestMethod
Output
I have also used a jwt encoder to look at the access token returned by Greetings |
Beta Was this translation helpful? Give feedback.
-
@bckrma I have done the same procedure as you and got the same error. Are there any News how it works? |
Beta Was this translation helpful? Give feedback.
-
Having a similiar problem using user credentials... do not want to give managed identity full write on all sites...
any solution to use Connect-PnPOnline with user credentials using a 7.2 powershell runbbok? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussed in #3088
Hi all,
I'm moving this to from discussions to issues since it's something that used to work that now doesn't. This is all about running in an Azure Runbook. I can successfully connect using Connect-PnPOnline with a cert and thumbprint in Azure Runbooks with PowerShell 5.1 and 7.1 using PnP.Powershell 1.12. This is the typical move:
$AdminURL = "https://mytenant-admin.sharepoint.com"
$TenantID = "b3asdf75-cca6-4bbf-9eb6-b01asdf8e5cf"
$ThumbPrint = "FA6738420527962ASDF3F3FE79B0CE68410F610FC"
$ClientID = "59sdfedf-6aa0-4d28-a2d9-1b3dsssd3115"
$Conn = Connect-PnPOnline -Url $AdminURL -ClientId $ClientID -Tenant $TenantID -Thumbprint $ThumbPrint -ReturnConnection
Get-PnPTeamsTeam -Connection $Conn
But now I need some of the new capabilities in PnP.PowerShell 2.1.1 and the above no longer works. Now, when I do the above move in an Azure Runbook using PowerShell 7.2 and PnP.PowerShell 2.1.1, it gives an error saying that it can't find a certificate with that thumbprint. And this runbook is in the same Automation Account using the same Shared Resources (certificate) as the PnP 1.12 that is working.
The actual error is: "Cannot find certificate with this thumbprint in the certificate store".
Any thoughts on what could be causing this? Did the methodology for using a certificate in Shared Resources change with 2.1.1?
Thanks in advance for your help!
Dave
Beta Was this translation helpful? Give feedback.
All reactions