You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the latest version of PnP SharePoint PowerShell with a script hosted in Azure Automation Runbook. Does anyone know how to use Connect-PnPOnline with Azure AD App registration method when script is run from Automation Runbook. Cmdlet requires a CertificatePath parameter. I tried to save the certificate in automation temporary storage and then running Connect-PnpOnline but it does not work.
I am noticing that runbook gets stuck and is then auto-restarts. Even when it executes Connect-PnpOnline statement, Get-PnPWeb does not work and come with an error.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the latest version of PnP SharePoint PowerShell with a script hosted in Azure Automation Runbook. Does anyone know how to use Connect-PnPOnline with Azure AD App registration method when script is run from Automation Runbook. Cmdlet requires a CertificatePath parameter. I tried to save the certificate in automation temporary storage and then running Connect-PnpOnline but it does not work.
`
Save certificate to automation temp location
$certificatePath = "$env:TEMP\temp.pfx";
$pfxCertificate = $certificate.Export(3, $certificatePassword);
Set-Content -Value $pfxCertificate -Path $certificatePath -Encoding Byte;
#Connect
$connection = Connect-PnPOnline -ReturnConnection -Url $url -ClientId $clientId -Tenant $tenantId -CertificatePath $certificatePath -CertificatePassword $secureCertificatePassword -ValidateConnection;
`
I am noticing that runbook gets stuck and is then auto-restarts. Even when it executes Connect-PnpOnline statement, Get-PnPWeb does not work and come with an error.
Beta Was this translation helpful? Give feedback.
All reactions