liveBook · Manning

Azure Virtual Machine Run Command

As explained in Practical Automation with PowerShell: Effective scripting from the console to the cloud

Azure Virtual Machine Run Command is an Azure capability that executes commands on an Azure virtual machine through the Azure service.

Azure Virtual Machine Run Command executes a command on an Azure virtual machine through Azure, without requiring direct network communication with the guest. The operator needs access to Azure over port 443, while Azure’s hypervisor integration handles execution. section 5.5

Use the capability when ordinary PowerShell remoting is impractical:

  • Configure an initial machine or enable native PowerShell remoting before normal remoting is available. section 5.5
  • Reach Azure machines in cloud, DMZ, or disjointed networks without opening network access to each virtual machine. section 5.5 section 5.7
  • Include Azure virtual machines in a broader automation strategy alongside WSMan, SSH, and Azure Automation Hybrid Workers. section 5.7

Centralized antivirus reinstallation

A single control script combined WSMan and SSH remoting for data-center servers with Azure Virtual Machine Run Command for Azure machines. This centralized approach reinstalled antivirus software across the environment in under an hour, avoiding manual connections and restoring business applications faster. section 5.7

Figure 5.8 Remote script execution using hypervisor-based remoting

Visualizes remote script execution through hypervisor-based remoting rather than direct guest-network communication. section 5.5

How Practical Automation with PowerShell: Effective scripting from the console to the cloud covers it

How deep it goes
Explains the access model and operational rationale, but stops short of providing Azure-specific command syntax or implementation code.
Examples
Uses initial configuration, DMZ access, and centralized antivirus reinstallation as operational examples.
What it assumes
Assumes Azure access and awareness that Azure virtual machine names may differ from names inside guest operating systems.
What you can do after
Operate Azure virtual machines centrally without establishing direct network connectivity to their guest operating systems.
How it connects
Connects hypervisor-based remoting with PowerShell remoting, WSMan, SSH, and Azure Automation Hybrid Workers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Practical Automation with PowerShell: Effective scripting from the console to the cloud. The section links point to the parts of the book it draws on.