0% found this document useful (0 votes)
24 views4 pages

Deploy and Manage Azure COmpute Resources

Uploaded by

Elia Feltrin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

Deploy and Manage Azure COmpute Resources

Uploaded by

Elia Feltrin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Deploy a basic vm

azure portal
enter a resource group > create > search for virtual machine > create
set name, region, availability option, set the image
set up the authentication method you prefer
set up disk
creste a new data disk (NB: it's different from the OS disk) if needed

set up name, size and type


create
bash
az vm create --name [name] --resource-group [reosurce group name] --image
[image] -- security-type [Standard | TrustedLaunch | Confidential] [--
authentication-type password --generate-ssh-keys | --authentication-type ssh --
admin-username --admin-password]
NB: az vm --help to get all flags

resize a vm
enter the vm > availability + scale (left panel) > size
choose the new size > resize
NB: if the vm is running, you cannot resize to all the possible sizes. Stop it
if you want more options
NB: resizing make the resource temporarly unavailable

create, attach and partition a disk


enter a resource group > crete > sesrch for managed disk > create
set name, region, zone and size
set other parameters if needed, otherwise use the default
create
enter the virtual machine > settings (left panel) > disks > attached exisisting
disk
select the new one
connect to the virtual machine via ssh (assuming linux):
run lsblk to list the mounted drives
run sudo parted /dev/[name of the disk] --script mklabel gpt xfspart [start
%]% [end %]%
run sudo mkfs.xfs -f /dev/[new partition name] in order to format it
run sudo partprobe /dev/[new partition name]

encrypt vm disk
powershell
create a key vault
New-AzKeyVault -Name [vault name] -ReosurceGroupName [rg name] -
Location [vault location] -EnabledForDiskEncryption
save vault details in a variable
$jeyvault = Get-AzKeyVault -VaultName [vault name] -ReosurceGroupName
[rg name]
encrypt the disk
Set-AzVmDiskEncruptionExtension -ResourceGroupName [rg name] -VMName
[vm name] -DiskEncryptionKeyVailtUrl $keyvault-VaultUri DiskEncryptionKeyVaultId
$keyvault.resourceId [-SkypVmBackup] -VolumeType All

create a vm across availability zones


enter the rg > creaate > search for virtual machine > create
set up all the other params
set availability options to availability zones
choose the AZs you want in the availability zones menu
next (networking) > create a load balancer (end of the page)
set name and protocol
create
create

create a vm in availibaility set


enter the rg > creaate > search for virtual machine > create
set up all the other params
set availability options to availability set
create new under availability set menu
set name, fault domains and update domains
ok
create
you can now create other vm inside the same availability set

configure vm scale set demo


enter the rg > search for scale set > create
set name, region, orchestration mode, image, size, authentication method
next (networking) > choose a vnet > set load balancing option to azure load
balancer > create a load balancer
set name, type, ...
create
next (scaling) > set initial, minimum, maximum number of instances
set threshold for scaling in/out and scale policy
next (advanced)
set allocation policy
copy into the custom data section this script
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-automate-
vm-deployment#create-cloud-init-config-file
create
you can enter the load balancer public afress via browser and test the scale
set

create an app service plan


enter a resource group > create > search app service plan > create
set name, operating system, ... , pricing plan
create

create an app service web app demo


enter a resource group > search for web app > crate
set a global unique name
set publish to code
set runtime stack to python 3.12
set operating system to linux
set region
set the app service plan
next (networking) > enable pubblic access
create
enter the web app
copy the default domain
try to access it trhough your browser
add a custom domain name
enter the webb app > settings (left panel) > costum domains > add a custom
domain
setup all configs
set add a certificate later under TLS/SSL certificate
create new under app service domanin
set the new domain
next (advanced) > disable auto renewal
create
go back to the web app page > settings (left panel) > custom domain > add
binding in the new domanin row
choose create app service managed certificate under source
add
access restriction
go back to the web app page > settings (left panel) > networking > click on
the link in the public network access row
choose your restriction rule s
NB: here you can also setup private endpoints, virtual network integrations
and hybrid connection
in the setting panel you can also setup scale up and out rules, backups and
restore from backups
enter deployment (left panel) > deployment slots > add slot
set name
set clone setting method
enter deployment (left panel) > deployment center
choose external git as source
set repository to https://github.com/pluralsight-cloud/hello-python-app.git
choose the main branch
you can try to access the wep app, restore a previos backup, swap deployment
slot

build and publish containers


enter a resource group > search for container registry > create
choose a global unique name
creat
enter the container registry > settings (left panel) > enable admin user
open powershell
run git clone https://github.com/pluralsight-cloud/Microsoft-Certified-
Azure-Administrator-Associate.git
cd into the introduction to containers folder
az acr build --image sample/hostanameapp:v1 --registry [previously
created container registry name] --file ./Dockerfile .
az acr run --registry [previously created container registry name] --
cmd '$Regitry/sample/hostanameapp:v1 /dev/null

create azure container instances


enter the reosurce group > search for container instances > create
set name, region, ...
set image source to Azure container registry
choose your previulsy created container registry, image and tag
choose the size
next (networking) > choose the container type (public/private), ...
next (advanced) choose the restart
create
enter the container instances page
copy the public IP adress and access it

create a container app


enter a resource group > search for container app > crate
set name, region, container environment
next (cointainer) > choose your previulsy created registru, image and tag
create
enter the container app > settings (left panel) > ingress
enable ingress
choose accepting traffic from enywhere
allow insecure connection
set target port to 80
save
go back to the overview page > try to access the application through the link
click on application (left panel) > scale > edit and deploy
you can add another application (container image > add)
next (scale) > set up scaling limit (down to 0 -> no costs)
set up scaling rules

You might also like