This lab will walk you through creating a Windows based Virtual Machine on the Azure Portal.
Note: This lab is part of a series of labs for Mastering the Virtual Machine Offers Workshop. You should finish this lab as well as prior ones before moving on to the next sections.
- Clone the repository to access files in scripts folder
- Navigate to the Homepage of Azure Portal
- Use the Search bar to search for Storage Accounts and hit enter. Select the vmworkshopsayouruniquestring Storage account we created in the previous lab.
- In the left pane, look for Data Storage and select Containers
- Click on + Container to create a new container
- Enter script as the new container name
- Select Blob for Public access level
- Click Create at the bottom of the page
- Open the new container, select Upload and upload the cloned script named custom_extension_windows.ps1
- If you open this script in VS Code or Notepad, you will see that it is running commands to install a web server and update the Virtual machine
- Navigate to the Homepage of Azure Portal
- Click on the + Create a resource button underneath Azure services
- Use the Search bar to search for Virtual Machines and hit enter. Select the Virtual Machine offered by Microsoft Azure Service and click on Create
At this point you will be taken to the Virtual Machine service with several blades for configuration.
-
Select the Subscription from the dropdown menu to select which subscription will pay for the VM and other resource usage
-
To create a new Resource Group, click on Create New and name your resource group as vmworkshop-rg-YOUR_UNIQUE_STRING. Please make sure to follow the same convention for ease of access and understanding.
Note that all the resources we create for the labs will reside within this new resource group
- Name your Virtual Machine vmworkshop-YOUR_UNIQUE_STRING
- Select the Region you are in from the dropdown menu
- Under Availability options, select No infrastructure redundancy required
- Select Standard Security type
- For Image, click on See all images and select Windows Server 2019 Datacenter - Gen1. Configure the generation from the Configure VM Generation link below if necessary.
- For size, click on See all sizes and select Standard_B2ms. This is sufficient to run this lab and will cost around $60/month, but regardless we will stop this virtual machine as soon as we generalize and capture the VM, so usage should be very low.
- Enter the username of your choice
- Enter a strong password of your choice
- Confirm the strong password
- Select the Allowed selected ports radio button for Public inbound ports
- For Select Inbound ports Select HTTP, RDP as well as HTTPS
- Leave the rest as is and Click Next : Disks >
- For OS Disk Type, select Standard HDD (locally-redundant storage)
Leave the rest of the fields as is on the page and click on Next : Networking >
- For Virtual network, Subnet, Public IP keep the default values as is. This will create a new VM, Subnet and Public IP with the default variable names
- Ensure Select inbound ports has HTTP, RDP and HTTPS checked
Leave the rest as is and click on Next : Management >
Do not change anything in this section and simply click on Next : Advanced >
-
Click on Select an extension to install
-
From the display card, select Custom Script Extension and click on Next
-
For Script file, browse for the vmworkshopsayouruniquestring storage account, select script and look for the custom_extension_windows.ps1 Block blob and select it. Lastly click Select at the bottom of the page. [If you dont see storage account, please make sure it is in the same region as the VM which is being created]
-
Now click Create under the Configure Custom Script Extension blade
-
Select Review + create button at the bottom of the Advanced blade
- In this blade, you should ensure that you receive the Validation Passed message at the top. If for any reason you receive a Validation failed message, you should go back and review the fields in red.
- Lastly take a look at the configurations you have selected and click Create
- At this point your deployment will start and show an in progress status.
- Once the deployment is complete, select Go to resource
- Copy Public IP Address from the created VM and paste it into a browser of your choice. This will show a public facing IP on the internet with a custom Welcome screen.
- Once you see the custom welcome screen, you know that the post deployment script has done its job.
In this module, we will remote into the vm and install an update manually.
-
On your Azure Portal, navigate to the VM you just created. Click on Connect from the tabs on the left under Settings.
-
In the RDP blade, select Download RDP file. This will download a copy to your local machine. Double-click the downloaded RDP file.
-
It will open a popup asking if you recognize the publisher. Click on Connect.
-
When asked for credentials, make sure to input the username and password you created for the VM.
-
Accept the certificate and click Yes when prompted.
-
Voila! You are now inside the VM.
-
Once the system is setup, search for Check for Updates in the VM and install all available updates
Note: Update all the shown updates before going further. Failure to do so will render your publish process on Partner center with errors
Congratulations! You have now finished this lab.
If you are in a live class setting, please raise your hand (even if virtually) to indicate you are done with the lab.