Hi Andreas,
I have invoked API calls to execute a remote command/script using the below steps. It worked for me.. thanks for your support.
https://blog.tekspace.io/access-azure-rest-api-using-powershell/
Regards,
Janakiraman
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Team,
I need to stop a application service running on a Linux server from PowerShell runbook in azure. Is there a way to use ssh keys to login and create New-PSSession session?
After stopping the application, i need to run another runbook. What is the best way to achieve this?
Thanks in advance.
Regards,
Janakiraman
Hi Andreas,
I have invoked API calls to execute a remote command/script using the below steps. It worked for me.. thanks for your support.
https://blog.tekspace.io/access-azure-rest-api-using-powershell/
Regards,
Janakiraman
Maybe this is helpful:
https://azure.microsoft.com/de-de/blog/managing-ssh-enabled-linux-hosts-with-azure-automation/
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
Hi Anderas,
I am getting the below error, not sure if my automation account needs any additional module or any setup at the target end. Can you please advice.
Invoke-AutomationSshCommand : The term 'Invoke-AutomationSshCommand' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:12 char:2
Regards,
Janakiraman.
It looks like the right module is not added to the Automation Account. For that reason you get a "Invoke-AutomationSshCommand is not recognized as the name of a cmdlet".
In the link I posted above is a PowerShell module linked:
https://gallery.technet.microsoft.com/scriptcenter/SSH-PowerShell-Module-17616e1a
There are a few SSH Powershell modules for SSH around in the PowerShell Gallery as well:
https://www.powershellgallery.com/packages?q=ssh
And third option: In the Automation Account -> Module Gallery are different SSH PowerShell modules available as well (search for "SSH" without the quotes)
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
Hello Andreas,
For some reason i am not able to figure out how to pass invoke a command/script or enter a session within powershell to my remote linux machine running in azure.
I am quite new to this, so i tried my level best but couldn't.
I have raised an ticket with microsoft and they are suggesting for Linux hybrid worker. I am in mid of deploying that solution, however i am getting an error there as well.
Its throws an error of unsupported runbook. The same is running fine if i use azure sandbox.
would you mind to share an sample command to for the SSH?
Regards,
Janakiraman