Creation a new SFTP session in an Azure Automation runbook blocks the job
I got a runbook which uses Posh-SSH for remote SSH work.
The following code seems to unregularly fail to execute, or, to pass execution back to powershell.
New-SFTPSession -ComputerName xxx -Credential $cred -KeyString $aws_ssh_key -AcceptKey
Following commands will not be executed, leading to infinite runtime (until Azure kills the job after 3h).
This happens on approximately 15-30% of all runbook executions. I have not found a way to implement error handling for this, since this does also not seem to work in background jobs. Background jobs in Azure using this cmdlet instantly finish, without actually executing the cmdlet.
Weird I though runbooks did not had registry support. The module still depends on the registry
Sent from my iPhone
On Aug 29, 2019, at 5:21 AM, wirelessy [email protected] wrote:
I got a runbook which uses Posh-SSH for remote SSH work. The following code seems to unregularly fail to execute, or, to pass execution back to powershell. New-SFTPSession -ComputerName xxx -Credential $cred -KeyString $aws_ssh_key -AcceptKey Following commands will not be executed, leading to infinite runtime (until Azure kills the job after 3h).
This happens on approximately 15-30% of all runbook executions. I have not found a way to implement error handling for this, since this does also not seem to work in background jobs. Background jobs in Azure using this cmdlet instantly finish, without actually executing the cmdlet.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Well it works just fine - most of the time. I basically just said "Deploy to Azure Automation" and started using it. Have not seen other unexpected behaviour from it, apart from the mentioned block/timeout.
Is there a way to troubleshoot this? As I mentioned, I was unable to build a workaround for this because of the execution-blocking behaviour.
dont know if its linked but Ive noticed when I run Get-SFTPsession | Remove-SFTPSession at the end of processing in Azure Automation it also seems to hang holding up the runbook.