Simple Hierarchy in PowerShell (SHiPs) is used in Azure to change directory into your cloud resources, much like you would change directory in a filesystem. This is useful for accounts that have many subscriptions and resource groups. In this hands-on lab, you will create a new Azure VM after changing directory into your resource group. Because the context is assumed in Cloud Shell, you don’t have to specify the resource group or subscription in order to create a VM in that location.
Successfully complete this lab by achieving the following learning objectives:
- Log in to the Azure Portal and Open Cloud Shell
- Navigate to https://portal.azure.com.
- Use the email and password provided with this hands-on lab to log in to the Azure Portal.
- Click the Cloud Shell icon (
>_) in top menu bar.
- Select PowerShell.
- Click Show advanced settings.
- Create a new storage account with a globally unique name.
- Create a file share named "fileshare".
- Click Create Storage.
- From the Azure Drive, Change Directory into the Resource Group
Set the directory location:
Show the PSProvider:
Output the name of the subscription:
Change directory into the subscription:
cd './P [hit the TAB key to autocomplete]'
Change directory into resource groups:
List the resource groups:
Change to the resource group by typing
cd ./and hitting Tab to autocomplete the name.
List its contents:
- Create a New Azure VM
From within the current directory, enter the following command to create a new Azure VM:
New-AzVM -Name 'myvm123' -Location 'westus' -VirtualNetworkName '<VIRTUAL_NETWORK_PROVIDED_WITH_LAB>' -SubnetName 'default' -SecurityGroupName '<NSG_PROVIDED_WITH_LAB>' -PublicIpAddressName 'myvm123pubip' -OpenPorts 80,3389