Closed dafunkphenomenon closed 1 year ago
I got the same error and submitted a ticket to Azure support. They responded that the WinSCP module is being blocked in Azure Runbooks for security purposes. The workaround is to use a User Hybrid Runbook Worker, and they provided this Get Started link: https://docs.microsoft.com/en-us/azure/automation/automation-windows-hrw-install Our whole goal of using the runbooks was to not involve any of our servers in this SFTP processing, but it looks like the hybrid worker requires a server to host it. Rather than set up the hybrid worker, I just put my scripts directly on the server that would have hosted the hybrid worker.
Same for me as of today, so no update/resolution, as far as I can tell. Same code works fine from a desktop (PS 5.1 or 7.3.1) but not within Azure runbooks (PS 5.1, 7.1 or 7.2). FWIW neither does Posh-SSH or even [system.net.webclient]. Seems like SFTP client side requires a full OS environment?
This sounds like the WinSCP module is not at fault for this issue, im going to go ahead and close this ticket.
This is correct. We compiled a custom DLL using the WinSCP library to test in Azure and it was also blocked. Apparently Microsoft sees FTP components running in Automation Accounts as a security risk.
Issue Description
Hi
I am trying to get this working in an Azure Automation but it constantly fails. Not sure if I'm missing something or it just doesn't work. I have been using the example provided in the documentation. WinSCP is installed from the modules gallery into my automation account. Thanks
Example
Expected Output
I would expect to see a connection established and details of the connecttion
Actual Output
WinSCP-PowerShell Version
5.17.10.0
Environment
Azure Automation