Mount your Azure Cloud Shell to another Storage Account

This post is about switching or mounting the Azure Cloud shell to another storage account. We are using Azure Cloud Shell for deploying our SQL Scripts using a PowerShell. First we will upload the script to the storage account file share and then we will execute some Powershell scripts for the deployment.

So first we need to identify the storage account we are using in the Cloud shell. We can run the Get-CloudDrive command to existing storage account.

Get-CloudDrive command

This command will give the existing storage account name. To switch the storage account, first we need to dismount the account using the Dismount-CloudDrive. Once this command is executed, we will get a prompt and you need to choose the Yes option.

Dismount-CloudDrive command

Once this command executed and finished, we will be able to see the Command Timeout Dialog - We need to select the ReConnect option.

Cloud Shell Timeout Dialog

In the next dialog choose the platform you like to use, since we are using PowerShell I am choosing PowerShell option.

No storage mounted

By default it will show No Storage Mounted dialog. Click on the Show advanced settings link and from the screen and which will display all the subscriptions, regions, resource groups, and available storage accounts under that subscription and resource groups.

Show Advanced settings

We can select the storage account, resource group and other settings. Once we select the details it will connect to the storage account and able to execute the powershell commands.

Happy Programming :)