Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

Using Blob Storage from the Azure Cloud Shell

Azure blob storage can be used to store nearly any kind of data. It can provide a complex storage backend for applications as well as a simple location to store the contents of important files. In this lab, you will have the opportunity to work through the simple process of creating a blob to store a simple data file. You do not always need to interact with Azure using the Azure portal. You can do so using Bash, and Azure offers a bash interface called Azure Cloud Shell. You can use Azure Cloud Shell to interact with Azure from a command line in your browser. This lab will provide you with the opportunity not only to work with storage blobs but to work with them using Azure Cloud Shell.

Azure icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon Feb 14, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create a storage account and configure authentication.

    1. Choose a storage account name. Include a unique string to ensure the name does not conflict with any existing storage account:
    export AZURE_STORAGE_ACCOUNT="sattrecords&ltunique string>"
    
    1. Set an environment variable containing the resource group to be used in future commands. You can find the resource group name in the Azure portal:
    export RESOURCE_GROUP="&ltresource group name>"
    
    1. Create the storage account:
    az storage account create 
      --name $AZURE_STORAGE_ACCOUNT 
      --resource-group $RESOURCE_GROUP 
      --location westus 
      --sku Standard_LRS 
      --encryption-services blob
    
    1. Get keys for the storage account:
    az storage account keys list 
      --account-name $AZURE_STORAGE_ACCOUNT 
      --resource-group $RESOURCE_GROUP 
      --output table
    
    1. Set an environment variable containing the storage account key so that future commands can authenticate:
    export AZURE_STORAGE_KEY="&ltkey>"
    
  2. Challenge

    Create a container.

    Use the following command to create a container to contain the blob:

    az storage container create --name records
    
  3. Challenge

    Upload the file as a blob and verify the data is stored in the blob

    1. Download the data file:
    wget https://raw.githubusercontent.com/linuxacademy/content-azurestoragedd-lab-resources/master/satt-special-cars.csv
    
    1. Upload the data as a new blob:
    az storage blob upload 
      --container-name records 
      --name cars 
      --file satt-special-cars.csv
    
    1. List existing blobs and verify that your new blob appears in the list:
    az storage blob list 
      --container-name records 
      --output table
    
    1. Download the blob data to a new file and check the file to verify that it contains the data:
    az storage blob download 
      --container-name records 
      --name cars 
      --file cars-dl.csv
    cat cars-dl.csv
    

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans