IaaS Solutions Flashcards
What are the components of Virutual Machines
(1) Resource Group
(2) VM Size
(Can upgrade and downgrade after deployment)
(3) Network
(Internal IP to connect to other Azure services or expose a public IP)
(4) Images
(Contains operating systems etc)
(5) Virtual Disks
(At least one disk but a additional disks to support application data)
What are the ways (tools) to deploy VM’s?
(1) Azure Portal
(2) Azure CLI
(3) PowerShell
(4) ARM Templates
Basic steps to create a VM
(1) Subscription
(2) Resource Group
(3) VM Name
(4) Region
(5) Availability Options
(6) Image
(7) Azure Spot Image
(8) Size
(9) Adminsitrator credentials
Azure Spot Image - allows Azure to stop and deallocate a VM if it needs the compute capcity for any region
What are the available services and ports available when provisioning a VM?
(1) HTTP (80)
(2) HTTPS (443)
(3) SSH (22)
(4) RDP (3389)
By default none of these services are available by default. They must be enabled during setup. More more configuration options, go to advanced settings.
Az Commands to create a VM
az vm create
–resource-group $rgname
–name $vmname
–image “win2019datacenter”
–admin-username “username”
–admin-password “password”
for linux replace –admin-password parameter
–authentication-type “ssh”
–ssh-key-value ~/.ssh/di-rsa.pub
Remember to create the resource group if needed
Az commands to enable Remote Access to a VM
az vm open-port
–resource-group $rg-name
–name $vmname
–port “3389” (–port “22” for Linux)
Az command to retrieve list of IP addresses for VM
az vm list-ip-addresses
–resource-group $rgname
–name $vmname
Basic PowerShell Commands to provision a VM
New-AzVm `
-ResourceGroupName ‘myResourceGroup’ `
-Name ‘myVM’ `
-Location ‘East US’ `
-VirtualNetworkName ‘myVnet’ `
-SubnetName ‘mySubnet’ `
-SecurityGroupName ‘myNetworkSecurityGroup’ `
-PublicIpAddressName ‘myPublicIpAddress’ `
-OpenPorts 80,3389
New-AzResourceGroup -Name ‘myResourceGroup’ -Location ‘EastUS’
What are the ARM template sections
(1) $schema
(2) contentVersion
(3) parameters
(4) variables
(5) functions
(6) resources
(7) outputs
What is the purpose of the parameters section in ARM Templates?
Allow you to pass different values to the ARM template for using during deployment.
This allows your templates to by more dynamic when deploying accross multipe environments
What is the purpose of the functions section in ARM templates?
Allow you to create complicated expression that you don’tw want to repeat throughout the template.
An example of a use for a function is for generating unique names for resources
What is the purpose of the variables section in ARM templates?
Allows you to define and use values throughout your template
i.e.
“variables”: {
“location”: “westus2”
}
What are the purpose of the resources section in ARM Templates?
Defines what Azure resources to deploy with the template anywhere from a small Network Security Group to a VM, Storage Account, or Azure Function
Basic definition
“name”: “MyEventGrid”,
“type”: “Microsoft.EventGrid”,
“apiVersion”: “<api>",
"tags": { "key": "value" },
"location": "westus2",
"dependsOn": [],
"properties": {}</api>
NOTES
(1) JSON files that define your resources
(2) Building blocks for automation
(3) Templates are submited Azure Resource Manager for provisioning
(4) Export an ARM template in Azure Portal
(5) Write your own
(6) Deploy from the Quickstart template library
Ways to deploy an ARM Template
(1) Azure Portal
(2) Azure CLI
(3) PowerShell (Az Module)
(4) REST API
(5) Azure Cloud Shell