This repository was archived by the owner on Jan 19, 2021. It is now read-only.
Issues with Connect-PnPOnline in Azure Automation Runbook #2860
Unanswered
steevinBradlee
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi there! I have a number of Azure Automation PowerShell runbooks for a client and I've noticed that often the scripts fail on Connect-PnPOnline. It happens very inconsistently but often times the scripts will fail to connect many times during a day but will suddenly be able to connect.
When they fail I see the following error:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 208.89.252.252:443 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord()
MFA is enabled on the tenant. I'm using credentials stored in the automation account. Code snippet below.
$psCredentials = Get-AutomationPSCredential -Name "svcSpoAdminIco" $siteUrl = "https://BLAAA.sharepoint.com/sites/TestSiteConsistency2" Connect-PnPOnline -Url $siteUrl -Credentials $psCredentials
SharePointPnPPowerShellOnline module version, 3.24.2008.1
Any help would be great. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions