Skip to main content

Starting IaaS Workloads with SHiPs in Azure PowerShell

Hands-On Lab

 

Photo of Chad Crowell

Chad Crowell

DevOps Training Architect II in Content

Length

01:00:00

Difficulty

Intermediate

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.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Starting IaaS Workloads with SHiPs in Azure PowerShell

Introduction

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.

Log in to the Azure Portal and Open Cloud Shell

  1. Log in to the Azure Portal using the credentials provided on the lab page.
  2. Click the Cloud Shell icon (>_) in the upper right.
  3. Select PowerShell.
  4. Click Show advanced settings.
  5. For Storage account, select Create new and give it a globally unique name (e.g., "cloudshell" with a series of numbers at the end).
  6. For File share, select Create new and give it a name of "fileshare1".
  7. Click Create storage.

From the Azure Drive, Change Directory into the Resource Group

  1. Output the name of the subscription:

    dir
  2. Change directory into the subscription:

    cd './P-2Z-Linux Academy Real Hands-On Labs/'

    Note: You can also do this by entering cd './P and hitting Tab to autocomplete the rest of the name.

  3. Change directory into resource groups:

    cd ./ResourceGroups/
  4. List the resource groups:

    dir
  5. Change to the resource group by typing cd ./ and hitting Tab to autocomplete the name.

  6. List its contents:

    dir

Create a New Azure VM

  1. From within the current directory, 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

    Hint: For the parameters above within <>, you can retrieve them by navigating to each resource in the Azure Portal via All resources or by searching.

  2. Make up a username and password for the VM. It will take a few minutes to finish creating.

    Note: The password must be between 12–72 characters long and contain three of the following requirements:

    • An uppercase character
    • A lowercase character
    • A numeric digit
    • A special character
  3. In the Azure Portal, navigate to Virtual machines. We should see the one we just created listed.

Conclusion

Congratulations on successfully completing this hands-on lab!