Today, I am starting on the concept of SAS, i.e., Shared Access Signature. This article will be covering the basics of SAS token such as - why it is required and how to delegate access to the resources within the storage account to external clients.

Before, starting about SAS tokens, let’s understand why we actually need them. Using the diagram below, let’s try to understand how an Azure Storage account is accessed by external clients without SAS. In this diagram, the user is directly accessing the Azure Storage account using an account key.

Demystifying SAS Token - Basics

This is not the recommended approach because of the following reasons.

Now, the obvious question is what is the recommended way to access the Azure Storage account?

The answer is “Shared Access Signature (SAS) Token”.

SAS is a secure way to grant limited access to the resources in your storage account to the external world (clients, apps), without compromising your account keys. It gives you the granular control over the type of access you grant to clients, which includes -

Shared Access Signature Types

  1. Service SAS
    It provides access to a resource in just one service provided by the storage account, such as Blob, Queue, Table or File.

  2. Account SAS
    It provides access to,

How Shared Access Signatures works

When a client uses a SAS URI as part of an input request, the storage service checks the SAS Token (parameters and signature) to verify if it is valid for authenticating the request. If the storage service verifies that the signature is valid, then the request is authorized. Otherwise, the request is declined with error code 403 (Forbidden).

Demystifying SAS Token - Basics

SAS URI - It is a signed URI which includes Storage Resource URI and SAS Token.

Storage URI – It points to one or more resources of your storage account. For example, blob container, file, queue, table or blob file, etc. as highlighted in the above diagram.

SAS Token – SAS token includes all the information which is used to access the resources in the form of a special set of query parameters as highlighted in the above diagram.

Demystifying SAS Token - Basics

In this article, we learned about SAS basics, so what's next? Please stay tuned for discussing SAS further in my future articles on: