In this article, we will look at how to create VM with PowerShell on the Azure Resource Manager(ARM).
At this moment, only the below are supported;
1. Create new ResourceGroup and new VM for Windows/Linux
2. Create multiple new subnets and multiple NICs on Windows/Linux
3. Create new NetworkSecurityGroup: This NSG is applied to a subnet.
Coming up in future iterations;(if someone want to get the function)
* Add new VM in existing ResourceGroup
First, we download the requisite PowerShell script.
Let’s start to create VM with PowerShell script which will create multiple subnets and NICs on the windows VM.
1. Run the script and type each values as highlighted in “red boxes” below.
You can see standard output on running script and it’s not fully added in here.
2. You should add administrator account and password when the credential window appears like below.
3. After the script runs as seen below, we finally see a completion message indicating that the VM is successfully created.
4. Verify if all of configurations are correctly done. You can find created all components from the resource group.
Also can find the multiple NICs and their info from the virtual network.
5. You can also see the virtual machine’s IP address information when you login through Remote Desktop Protocol (RDP).
We see all of components are successfully created.
Now, let’s create a VM which is on a single subnet and a single NIC on Windows VM.
All of the steps are same with above multiple subnets.
* Windows VM with single subnet and NIC
Next, We will see all of the steps for Linux VM (multiple subnets/NICs and single subnet/NIC)
All of the steps are same with Windows VM.
1. Create Linux VM with multiple subnets and NICs
This script is supporting to the SSH-Key for Linux authentication and also you can just use username and password.
When credential popup window, you should type password even though you want to use SSH.
1-1. Verify for Linux multiple subnets and NICs
After created new VM, you should add rules of the NetworkSecrityGroup policy.
2. Create Linux VM with single subnet and NIC
2-1. Verify for Linux single subnet and NIC