LAB 03c-Manage Azure Resources by Using Azure PowerShell
LAB 03c-Manage Azure Resources by Using Azure PowerShell
lab:
title: '03c - Manage Azure resources by Using Azure PowerShell'
module: 'Module 03 - Azure Administration'
---
## Lab scenario
Now that you explored the basic Azure administration capabilities associated with
provisioning resources and organizing them based on resource groups by using the
Azure portal and Azure Resource Manager templates, you need to carry out the
equivalent task by using Azure PowerShell. To avoid installing Azure PowerShell
modules, you will leverage PowerShell environment available in Azure Cloud Shell.
## Objectives
## Architecture diagram

## Instructions
### Exercise 1
1. In the portal, open the **Azure Cloud Shell** by clicking on the icon in the top
right of the Azure Portal.
>**Note**: If this is the first time you are starting **Cloud Shell** and you
are presented with the **You have no storage mounted** message, select the
subscription you are using in this lab, and click **Create storage**.
1. If prompted, click **Create storage**, and wait until the Azure Cloud Shell pane
is displayed.
#### Task 2: Create a resource group and an Azure managed disk by using Azure
PowerShell
In this task, you will create a resource group and an Azure managed disk by using
Azure PowerShell session within Cloud Shell
```powershell
$location = (Get-AzResourceGroup -Name az104-03b-rg1).Location
$rgName = 'az104-03c-rg1'
```powershell
Get-AzResourceGroup -Name $rgName
```
1. To create a new managed disk with the same characteristics as those you created
in the previous labs of this module, run the following:
```powershell
$diskConfig = New-AzDiskConfig `
-Location $location `
-CreateOption Empty `
-DiskSizeGB 32 `
-Sku Standard_LRS
$diskName = 'az104-03c-disk1'
New-AzDisk `
-ResourceGroupName $rgName `
-DiskName $diskName `
-Disk $diskConfig
```
```powershell
Get-AzDisk -ResourceGroupName $rgName -Name $diskName
```
In this task, you will managing configuration of the Azure managed disk by using
Azure PowerShell session within Cloud Shell.
1. To increase the size of the Azure managed disk to **64 GB**, from the PowerShell
session within Cloud Shell, run the following:
```powershell
New-AzDiskUpdateConfig -DiskSizeGB 64 | Update-AzDisk -ResourceGroupName $rgName
-DiskName $diskName
```
```powershell
Get-AzDisk -ResourceGroupName $rgName -Name $diskName
```
```powershell
(Get-AzDisk -ResourceGroupName $rgName -Name $diskName).Sku
```
```powershell
New-AzDiskUpdateConfig -Sku Premium_LRS | Update-AzDisk -ResourceGroupName
$rgName -DiskName $diskName
```
```powershell
(Get-AzDisk -ResourceGroupName $rgName -Name $diskName).Sku
```
>**Note**: Do not delete resources you deployed in this lab. You will reference
them in the next lab of this module.
#### Review