Task: Access Storage Content

Video: Shared Access Signatures

Estimated time: 30 minutes

Goal

In this task you will implement a shared access signature for a blob file. First you will provision a storage account and a private blob container. Then you will upload a file to the container. Next you will define an access policy for the container. Finally you will generate a shared access signature for the file and verify file access.

Pre-requisites

  1. Azure subscription
  2. A file (any file, but nothing sensitive)

Requirements

  1. Provision a storage account and a blob container
  2. Upload a file to the container
  3. Define an access policy for the container
  4. Use a SAS for blob access

Requirement 1: Provision a storage account and a blob container

You will begin by provisioning a storage account and a blob container. Use the following settings:

Setting Value
Resource group task-storage-access
Name <unique name>
Performance Standard
Account kind StorageV2
Replication LRS
Access tier Hot
Security Enabled
Data protection Disabled
Setting Value
Name secure
Public access level Private

Requirement 2: Upload a file to the container

Upload a file to the secure container. There really isn't much else to say on this one.

Requirement 3: Define an access policy for the container

Define a storage access policy for the secure container. Use the following settings:

Setting Value
Name task-policy
Permissions Read, List
Expiration <one week from now>

Requirement 4: Use a SAS for blob access

Create a SAS for the blob file that you uploaded in requirement 2 based on the task-policy policy. Use the SAS with the url of the file to download it from a browser tab. Follow these steps to complete this requirement:

Clean up

Solution

Having trouble completing this task? View the demonstration video to see how to do it.