Uploading files to cloud drive using Azure Cloud Shell

Uploading files to cloud drive using Azure Cloud Shell

You can manage your Azure account using the Azure Web Portal or via Azure Cloud Shell. Azure Cloud Shell provided an authenticated, interactive and browser-based shell for managing Azure resources. It also provided choosing the shell experience for both PowerShell or Bash command. Azure Cloud Shell requires an Azure Files Storage, a cloud drive to be mounted as to persist files.

When you instantiate the Azure Cloud Shell for the very first time it creates all the required Azure resources and mounts them accordingly.

Quick Overview of Azure Cloud Shell:

Click the Cloud Shell button on the menu in the upper right of the Azure portal.


Azure Cloud Shell - Initiate

Shell will have both options for Bash and Powershell. Select the PowerShell environment from the drop-down and you will be on your cloud drive.  In case you are launching it for the first time, you need to first create a storage and then mount the drive, however, this is just matter of a single click.

Related Tip: Setting up Continuous Delivery for Azure App Services from Azure Portal

Let’s check how it works. If you are familiar with PowerShell, now you can leverage your PowerShell skills to play around with all azure resources. For an instance, type following command to change Shell directory from root to a specific subscription.


PS Azure:\> cd  "Visual Studio Ultimate with MSDN"

You will have output as below

Azure:\Visual Studio Ultimate with MSDN

PS Azure:\>

Now again execute the following command

Azure:\Visual Studio Ultimate with MSDN

PS Azure:\> cd AllResources

and then

PS Azure:\> dir

The Azure Cloud Shell will list out all the Azure resources as shown in below image.


Azure Cloud Shell - PowerShell Command Example


This was just an example of how the cloud shell works. Now you can start exploring it with all the PowerShell commands or scripts.

Uploading Files using Azure Cloud Shell:

Coming back to the context of this post, if you want to upload any files to the mounted storage of the cloud shell, you can do it using PowerShell scripts.  However, you can easily do it without using the script. Just select the upload button in the Toolbar of the cloud shell. That’s it.

Azure Cloud Shell File Upload

Once the upload is successful, you will get a notification as shown below.

Azure Cloud Shell - File Uploaded

Once the upload is successful, You can navigate to the cloud drive resources and check out for the all the files that were uploaded.


Azure Cloud Shell - File Uploaded Lists


Azure Cloud Shell is very powerful and if you have good command over PowerShell of bash scripting you can do things much faster.


Hope this helps.


Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

One Comment to “Uploading files to cloud drive using Azure Cloud Shell”

Comments are closed.