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
Example of using a variable within an ARM Template
“location”: “[variables(‘location’)]”
for parameters, it will be “[parameters(‘param1’)]”
PowerShell command for deployment
New-AzResourceGroupDeployment
–Name
–ResourceGroupName
–TemplateFile
–TemplatgeParameterFile
Containers
Identity the container fundelmentals
(1) Binaries => libraries and other components
(2) Container Image => binary application package
(3) Container => running container image
(4) One app inside a container
(5) General very small and very portable
(6) Container Registries => enables exchanging of container images
NOTE
Basics of a Dockerfile
FROM => runtime
RUN => set directory
WORKDIR => set working directory
COPY => copy from the publishing folder
COPY => copy config.sh file
RUN => bash config.sh
EXPOSE => Port
ENTRYPOINT => [“dontnet”, “webapp.dll”]
docker build -t webappimage:v1
Containers
What is the ACR and key functions?
Azure Container Registry
(1) Build, store, and manage container images
(2) Key component of buildingthe CI/CD pipeline
(3) ACR Tasks for container image automation
(4) Services tiers [Basic, Standard, Premium]
Containers
Types of authentications in ACR?
(1) Azure Active Directory Identities
Users
Service Principals
(2) ACR Admin
ACR provides Role-based access controls
Types of users/roles in ACR
(1) Owner
(2) Contributor
(3) Reader
(4) AcrPush
(5) AcrPull
(6) AcrDelete
Roles are assigned to tools
Containers
Az Command to create ACR
az acr create
–resource-group $rsname
–name $acrname
–sku “Standard”
az acr login –name $acrname
Information - Pushing an image into ACR
ACR_NAME = ‘kevinacr’
ACR_LOGINSERVER = $(az acr show –name $ACR_NAME –query
loginService –output tsv)
docker tag webappimage:v1 $ACR_LOGINSERVER/webappimage:v1
docker push $ACR_LOGINSERVER/webappimage:v1
az acr build –image “webimage:v1-acr-task” –registry $ACR_NAME
Containers
What are Azure Container Instances
Is a service (serverless) that enables developers to deploy containers without having to provision or manage any underlying infrasture
Information - Creating a Service Principal For ACI to PULL from ACR
Containers
Creating a ACR using Az Commands
az container create
–resource-group
–name
–dns-name-label
–ports
–image $ACR_LOGINSERVER/webappimage:v1
–registry-login-server @ACR_LOGINSERVER
–registry-username
–registry-password
ACR_LOGINSERVER = $(az acr show –name $ACR_NAME –query loginService –output tsv)