How to run scripts in your Azure VM by using Run Command 🔧

preview_player
Показать описание
In this video, we are going to have a look at how to run scripts in your Azure VM by using Run Command. You can access your Azure virtual machine (VM) in multiple ways, like SSH or RDP. However, if you have issues with the RDP or SSH network configuration, the Run Command feature is another option. Run Command can run a PowerShell or shell script within an Azure VM remotely by using the VM agent. This scenario is especially useful when you need to troubleshoot operating system network configurations or user access configuration. We are going to have a look at how you can run scripts against multiple Azure virtual machines (VMs) by using PowerShell and the Invoke-AzVMRunCommand feature.

🔧 Links:

📺 Agenda:

0:00 Intro
0:45 Azure VM Run Command
1:48 Run Scripts on Azure VMs from the Azure Portal
6:02 Run Scripts using PowerShell and Cloud Shell against Azure virtual machines
9:26 Run Scripts against multiple VMs using a PowerShell script
23:54 Wrap up
Рекомендации по теме
Комментарии
Автор

Your video was HELFUL Thomas, INDEEED!!! thanks a lot Bro!!!! You´re a rockstar!!!!

Cmart
Автор

Amazing video, Thomas! Thank you!
I've been wondering if it's possible to use this method through runbooks, but I believe that there is not command "code". Would be great if we could create something like a string into own code to write the ps1 file.

harrydesanto
Автор

Hey Thomas, this was awesome! Thank you so much for carefully going through the example. This will be a very useful way for us to better manage our environment.

SmallvilleJW
Автор

This is brilliant!...I did try run command in automation run book but the only problem is that it is not displaying the output result after running the script ..Any idea how I can get that?

sochaktatai
Автор

Thank you for this video it is great! Is it possible for example to run 'az version' on the remote vm? when I try this with scripts like you did I fail because 'az' is not recognized, but on the VM itself with Remote Desktop Connection it works

xxxxxx
Автор

Great video. I have been trying to use the same method to execute an existing python script on VM. But it says that Python is not installed, although it is. Any clue?

vipulm
Автор

hi Thomas Maurer
is there any option if we can run this script for certain VMs we want instead of the entire resources group?

zzaidi_
Автор

Brilliant video. Quick question, if you want to call the script from a runbook, where do you store the script. Can you upload the script to blob and call from there?

soccerschannel
Автор

Hi, would it be possible to show an example of running a VM in interactive mode?
This will help in setting up a testing pipeline which is going to pull latest automation scripts from azure git-repo into the vm, and then lanch the automation testing tool. Which will execute functional tests.

I am struggling with invoking the vm/agent through the pipeline. Then I have to run automation tests on that agent/vm

srajpoot
Автор

I am getting error at line 2: $out = Invoke-AzVMRunCommand "Cannot Index into a null array". How to resolve that ?

anuradhasharma
Автор

Do you take powershell scripting coding

navyak
Автор

I think there is time out of 90 mins to run powershell script using this command on azure vm. Is there any alternative to this which can run for more than 90 mins. We need to run powershell scripts on vm which takes around 3 to 4 hrs.

shashidec
Автор

Is that fake bamboo tree behind you from Ikea? haha I have the same one.

dasiths
Автор

I needed a script to run at start up so off to find another video.

jannarkiewicz
Автор

Hi Thomas,
Thanks for a informative video, can you please let me know how do i run the "Invoke-AzVMRunCommand" through a function app or logic app.

venkateshkosuru