Azure 

Azure Cloud Shell series 1

Azure Cloud Shell is an interactive, authenticated, browser-accessible shell for managing Azure resources. It provides the flexibility of choosing the shell experience that best suits the way you work, either Bash or PowerShell.

Accessing Cloud Shell can be done in two ways mainly

  1. https://shell.azure.com
  2. Accessing the cloud shell from the Azure Portal

Once you have selected any of the methods you will be promoted to ask to choose any shell of your preference.

You can choose either Bash or PowerShell. I will be focusing on PowerShell in this tutorial. You will be prompted to choose the subscription in the next step.

In the background what happening is Azure builds a Linux based container and utilizes PowerShell core in it. The container image will be stored inside a storage unit that is automatically created by Azure as below :

Since this in turn uses a storage unit we will be charged for using Cloud Shell and you can see the pricing details from the below link :

Pricing – Cloud Shell | Microsoft Azure

Since the PowerShell core is installed in Linux, some of the aliases that is available in normal PowerShell has been removed from CloudShell to avoid conflicts.

What if you want to add your own custom storage account ?

The default storage azure builds for us has limit of 6GB size. What if you want to build a cloud shell with a custom storage account of 10GB size.

  1. Create your desired storage account from the storage blade.
  2. Go to the newly created storage account page and click the File Share option.
  3. Create a file share with the desired size and name.

4. Once the File Share has been created log back into your Cloud Shell console and use the following command to see your current details

<code>Get-CloudDrive

5. Dismounting your existing drive and attaching new one

Dismount-CloudDrive

Since we removed the storage drive which was needed for running Cloud Shell we will kicked out from the shell automatically.

Now we will be again asked to choose the preferred shell “Bash” or “PowerShell” and in the next page the subscription.

Now here you can see an advanced settings option and using that we will be telling azure to use our custom storage account for Cloud Shell

6. Now you can chek and confirm our new drive has been attached again using the command :

Get-CloudDrive

Related posts

Leave a Comment