To create and manage Shared Access Policies, we will use the Azure CLI and the following command:
az storage container policy
Note that policies management and generating tokens based on them is also possible when using SDKs for different programming languages. However, this book is trying to provide you with a generic way of controlling them, so we are not tied to a specific language.
To create a policy connected to a container, we will use the following command:
$ az storage container policy create -c "<container-name>" -n "<policy-name>" --account-name "<account-name>" --permissions "rl"
Creating a policy using the Azure CLI will result in JSON output similar to the following:
{
"etag": "\"0x8D6BAB88E733C7D\"",
"lastModified": "2019-04-06T17:51:54+00:00"
}
For the --permissions parameter, you can use any combination of the...