Forum Discussion

Serg08's avatar
Serg08
Copper Contributor
May 06, 2021
Solved

Create and configure several Virtual machine

Hi Please help to understand if it's possible to write PowerShell script for next steps. 1.Connect to Azure 2. Create Virtual machine 3. Make additional configurations into VM (by Remote PowerShe...
  • pazdedav's avatar
    May 06, 2021
    Hi, if you don't want to / cannot expose your VM to the Internet (so you can connect to it from your machine) and if we exclude options like P2S VPN between your machine an Azure VNet, where your VM gets deployed, there are three options:
    1. You can use a Custom script VM Extension with either a shell or a PowerShell script. The script itself could either be provided in-line or referenced via a public URI. VM Extensions are Azure resources, so they can be created programmatically in both imperative (script) and declarative (ARM JSON, Bicep, Terraform) way. More info: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows
    2. You could use Run Command feature, more info here: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command
    3. You could use a proven Config management tool like Chef, Puppet, Ansible, etc. but this requires more infrastructure, and it is more complex to implement.

Resources