Az Cli Flashcards
How can I create an azure resource group?
Az group create –name –location
How to create an azure vm
az vm create
- -name <>
- -resource-group <>
- -image «_space;name image to restore ex: win16 datacenter»_space;
- -size «_space;sizing ex: Standard_DS2_v2»_space;
- -location <>
- -admin-username <>
- -admin-password <>
Is a vm reachable from the internet?
By default, Azure assigns a public IP address to your VM. You can configure a VM to be accessible from the Internet or only from the internal network
How to check if vm is running?
az vm get-instance-view
- -name <>
- -resource-group <>
- -output table
What is the custom Script Extension
The Custom Script Extension is an easy way to download and run scripts on your Azure VMs
Custom script to install is
az vm extension set \
- -resource-group a6da4425-41cb-4ac8-95bd-1385151b034f \
- -vm-name myVM \
- -name CustomScriptExtension \
- -publisher Microsoft.Compute \
- -settings ‘{“fileUris”:[“https://raw.githubusercontent.com/MicrosoftDocs/mslearn-welcome-to-azure/master/configure-iis.ps1”]}’ \
- -protected-settings ‘{“commandToExecute”: “powershell -ExecutionPolicy Unrestricted -File configure-iis.ps1”}’
How to open a port on a vm?
az vm open-port
- -name <>
- -resource-group <>
- -port <>
How to show info about vm?
az vm show
- -name <>
- -resource-group <>
- -show-details
- -query [<>]
- -output tsv
Difference between scaling up and scaling out
Scaling up is adding more memory,cpu, storage. Scaling out(horizontal) is adding virtual machines
Cloud is elastic, you scare scale up and down, out and in
How do I resize vm?
az vm resize
- -resource-group <>
- -name <>
- -size Standard_DS3_v2
What are availability zones?
Availability Zones are physically separate datacenters within an Azure region.
Each Availability Zone is made up of one or more datacenters equipped with independent power, cooling, and networking. It is set up to be an isolation boundary. If one zone goes down, the other continues working.
What is an availability set?
An availability set is a logical grouping of two or more VMs that ensure your application remains available during planned or unplanned maintenance.
What are update domains?
Update domain assures that if one of the VMs is undergoing planned maintenance, the other VMs are available and not undergoing maintenance at the same time.
By default, 5 update domains are created.
What are fault domains?
A fault domain assure that if there is a fault on a machine, the switch is made to a different vm in the domain. A fault domain is essentially a rack of servers. It provides the physical separation of your workload across different hardware in the datacenter.
By default, 2 fault domains are created.
What are virtual machine scale sets?
Azure virtual machine scale sets let you create and manage a group of identical, load balanced VMs. This makes it possible to automatically upscale or downscale the number of VMs needed at the time.