Deployment Scenarios

About

This page holds different scenarios or exercises completed in the AZ-104 Learn modules.

Scenario 1

Technically from one of the pre-requisite modules around managing Azure resources.

  1. Create a cloud shell storage account (done via portal)
  2. Create a resource group to hold the AZ-104 test resources
  3. Create the various resources in the appropriate resource group
    1. Storage account and file share
    2. Disk object
    3. Convert to a bicep file and compare the conversion against the manual bicep file.

This skips their steps around getting the disk and changing the performance to Premium_LRS via New-AzDiskUpdateConfig -Sku Premium_LRS | update-AzDisk -ResourceGroupName $rg.ResourceGroupName -DiskName $diskName

$rg = New-AzResourceGroup -Name 'rg-az-104-pwsh' -Location "WestUS3"
$location = ((Get-AzResourceGroup -Name $rg.ResourceGroupName).Location).ToLower()
$tags = @{
    environment = 'Learning'
    module = 'AZ-104'
    method = 'powershell'
}
$storageAccount = New-AzStorageAccount -Name "storageaz104pwsh$location" -ResourceGroupName $rg.ResourceGroupName -Location $rg.Location -SkuName "Standard_LRS" -AllowBlobPublicAccess $false -Tag $tags

New-AzStorageShare `
-Name -"storage-az104-$location" `
-Location $location `
-ResourceGroupName $rg.ResourceGroupName

$diskConfig = New-AzDiskConfig `
-Location $location `
-CreateOption Empty `
-DiskSizeGB 32 `
-SkuName Standard_LRS
$diskName = 'disk-az104-00'

New-AzDisk `
-ResourceGroupName $rg.ResourceGroupName `
-DiskName $diskName `
-Disk $diskConfig

New-AzDiskUpdateConfig -DiskSizeGB 64 | Update-AzDisk -ResourceGroupName $rg.ResourceGroupName -DiskName $diskName