Skip to content

Commit 4a46726

Browse files
committed
fix links and add redirect
1 parent 9702502 commit 4a46726

File tree

5 files changed

+47
-37
lines changed

5 files changed

+47
-37
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25796,6 +25796,11 @@
2579625796
"redirect_url": "/azure/storage/common/storage-account-create",
2579725797
"redirect_document_id": true
2579825798
},
25799+
{
25800+
"source_path": "articles/storage/common/authorize-active-directory-cli.md",
25801+
"redirect_url": "/azure/storage/common/authorize-data-operations-cli",
25802+
"redirect_document_id": true
25803+
},
2579925804
{
2580025805
"source_path": "articles/storage/common/storage-account-manage.md",
2580125806
"redirect_url": "/azure/storage/common/storage-account-keys-manage",

articles/storage/blobs/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@
284284
- name: PowerShell
285285
href: ../common/authorize-active-directory-powershell.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
286286
- name: Azure CLI
287-
href: ../common/authorize-active-directory-cli.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
287+
href: ../common/authorize-data-operations-cli.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json
288288
- name: Manage access rights with RBAC
289289
items:
290290
- name: Portal

articles/storage/blobs/storage-quickstart-blobs-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For more information about authentication` with Azure CLI, see [Sign in with Azu
4040

4141
You can authorize access to Blob storage from the Azure CLI either with Azure AD credentials or by using the storage account access key. Using Azure AD credentials is recommended. This article shows how to authorize Blob storage operations using Azure AD.
4242

43-
Azure CLI commands for data operations against Blob storage support the `--auth-mode` parameter, which enables you to specify how to authorize a given operation. Set the `--auth-mode` parameter to `login` to authorize with Azure AD credentials. For more information, see [Run Azure CLI commands with Azure AD credentials to access blob or queue data](../common/authorize-active-directory-cli.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json).
43+
Azure CLI commands for data operations against Blob storage support the `--auth-mode` parameter, which enables you to specify how to authorize a given operation. Set the `--auth-mode` parameter to `login` to authorize with Azure AD credentials. For more information, see [Authorize access to blob or queue data with Azure CLI](../common/authorize-data-operations-cli.md?toc=%2fazure%2fstorage%2fblobs%2ftoc.json).
4444

4545
Only Blob storage data operations support the `--auth-mode` parameter. Management operations, such as creating a resource group or storage account, automatically use Azure AD credentials for authorization.
4646

articles/storage/common/authorize-data-operations-cli.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ ms.subservice: common
1717

1818
Azure Storage provides extensions for Azure CLI that enable you to specify how you want to authorize operations on blob or queue data. You can authorize data operations in the following ways:
1919

20-
- By specifying Azure Active Directory (Azure AD) credentials (recommended).
21-
- By specifying the account access key or a shared access signature (SAS) token.
20+
- With an Azure Active Directory (Azure AD) security principal. Microsoft recommends using Azure AD credentials for superior security and ease of use.
21+
- With the account access key or a shared access signature (SAS) token.
2222

2323
## Specify how data operations are authorized
2424

@@ -27,53 +27,30 @@ Azure CLI commands for reading and writing blob and queue data include the optio
2727
- Set the `--auth-mode` parameter to `login` to sign in using an Azure AD security principal.
2828
- Set the `--auth-mode` parameter to the legacy `key` value to attempt to query for an account key if no authentication parameters for the account are provided.
2929

30-
## Call Azure CLI commands using Azure AD credentials
30+
To use the `--auth-mode` parameter, make sure that you have installed Azure CLI version 2.0.46 or later. Run `az --version` to check your installed version.
31+
32+
## Authorize with Azure AD credentials
3133

3234
When you sign in to Azure CLI with Azure AD credentials, an OAuth 2.0 access token is returned. That token is automatically used by Azure CLI to authorize subsequent data operations against Blob or Queue storage. For supported operations, you no longer need to pass an account key or SAS token with the command.
3335

3436
You can assign permissions to blob and queue data to an Azure AD security principal via role-based access control (RBAC). For more information about RBAC roles in Azure Storage, see [Manage access rights to Azure Storage data with RBAC](storage-auth-aad-rbac.md).
3537

36-
### Supported operations
38+
### Permissions for calling data operations
3739

3840
The Azure Storage extensions are supported for operations on blob and queue data. Which operations you may call depends on the permissions granted to the Azure AD security principal with which you sign in to Azure CLI. Permissions to Azure Storage containers or queues are assigned via RBAC. For example, if you are assigned the **Blob Data Reader** role, then you can run scripting commands that read data from a container or queue. If you are assigned the **Blob Data Contributor** role, then you can run scripting commands that read, write, or delete a container or queue or the data they contain.
3941

4042
For details about the permissions required for each Azure Storage operation on a container or queue, see [Call storage operations with OAuth tokens](/rest/api/storageservices/authorize-with-azure-active-directory#call-storage-operations-with-oauth-tokens).
4143

42-
### Example: Authorize with Azure AD
43-
44-
The following example shows how to create a container in a new storage account from Azure CLI using your Azure AD credentials. Remember to replace placeholder values in angle brackets with your own values:
45-
46-
1. Make sure that you have installed Azure CLI version 2.0.46 or later. Run `az --version` to check your installed version.
47-
48-
1. Run `az login` and authenticate in the browser window:
44+
### Example: Authorize an operation to create a container with Azure AD credentials
4945

50-
```azurecli
51-
az login
52-
```
53-
54-
1. Specify your desired subscription. Create a resource group using [az group create](https://docs.microsoft.com/cli/azure/group?view=azure-cli-latest#az-group-create). Create a storage account within that resource group using [az storage account create](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-create):
55-
56-
```azurecli
57-
az account set --subscription <subscription-id>
58-
59-
az group create \
60-
--name sample-resource-group-cli \
61-
--location eastus
62-
63-
az storage account create \
64-
--name <storage-account> \
65-
--resource-group sample-resource-group-cli \
66-
--location eastus \
67-
--sku Standard_ZRS \
68-
--encryption-services blob
69-
```
46+
The following example shows how to create a container from Azure CLI using your Azure AD credentials. To create the container, you'll need to log in to the Azure CLI, and you'll need a resource group and a storage account. To learn how to create these resources, see [Quickstart: Create, download, and list blobs with Azure CLI](../blobs/storage-quickstart-blobs-cli.md).
7047

7148
1. Before you create the container, assign the [Storage Blob Data Contributor](../../role-based-access-control/built-in-roles.md#storage-blob-data-contributor) role to yourself. Even though you are the account owner, you need explicit permissions to perform data operations against the storage account. For more information about assigning RBAC roles, see [Grant access to Azure blob and queue data with RBAC in the Azure portal](storage-auth-aad-rbac.md).
7249

7350
> [!IMPORTANT]
7451
> RBAC role assignments may take a few minutes to propagate.
7552
76-
1. Call the [az storage container create](https://docs.microsoft.com/cli/azure/storage/container?view=azure-cli-latest#az-storage-container-create) command with the `--auth-mode` parameter set to `login` to create the container using your Azure AD credentials:
53+
1. Call the [az storage container create](/cli/azure/storage/container#az-storage-container-create) command with the `--auth-mode` parameter set to `login` to create the container using your Azure AD credentials. Remember to replace placeholder values in angle brackets with your own values:
7754

7855
```azurecli
7956
az storage container create \
@@ -82,13 +59,41 @@ The following example shows how to create a container in a new storage account f
8259
--auth-mode login
8360
```
8461
85-
## Call Azure CLI commands using the account access key
62+
## Authorize with the account access key
63+
64+
If you possess the account key, you can call any Azure Storage data operation. In general, using the account key is less secure. If the account key is compromised, all data in your account may be compromised.
65+
66+
The following example shows how to create a container using the account access key:
8667
68+
```azurecli
69+
az storage container create \
70+
--account-name <storage-account> \
71+
--name sample-container \
72+
--auth-mode key
73+
```
8774

75+
## Authorize with a SAS token
76+
77+
If you possess a SAS token, you can call data operations that are permitted by the SAS. The following example shows how to create a container using a SAS token:
78+
79+
```azurecli
80+
az storage container create \
81+
--account-name <storage-account> \
82+
--name sample-container \
83+
--sas-token <token>
84+
```
8885

8986
## Set environment variables for authorization parameters
9087

91-
The environment variable associated with the `--auth-mode` parameter is `AZURE_STORAGE_AUTH_MODE`. You can specify the appropriate value in the environment variable to avoid including it on every call to an Azure Storage data operation.
88+
You can specify authorization parameters in environment variables to avoid including them on every call to an Azure Storage data operation. The following table describes the available environment variables.
89+
90+
| Environment variable | Description |
91+
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
92+
| AZURE_STORAGE_ACCOUNT | The storage account name. This variable must be used in conjunction with either the storage account key or a SAS token. If neither are present, the command will attempt to query the storage account key using the authenticated Azure AD account. If a large number of storage commands are executed at one time, the API throttling limit may be reached. |
93+
| AZURE_STORAGE_KEY | The storage account key. This variable must be used in conjunction with the storage account name. |
94+
| AZURE_STORAGE_CONNECTION_STRING | A connection string that includes the storage account key or a SAS token. This variable must be used in conjunction with the storage account name. |
95+
| AZURE_STORAGE_SAS_TOKEN | A shared access signature (SAS) token. This variable must be used in conjunction with the storage account name. |
96+
| AZURE_STORAGE_AUTH_MODE | The authorization mode with which to run the command. Permitted values are `login` (recommended) or `key`. If you specify `login`, the Azure CLI will use your Azure AD credentials to authorize the data operation. If you specify the legacy `key` mode, the Azure CLI will attempt to query for the account access key and authorize the command with the key. |
9297

9398
## Next steps
9499

articles/storage/queues/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
- name: PowerShell
117117
href: ../common/authorize-active-directory-powershell.md?toc=%2fazure%2fstorage%2fqueues%2ftoc.json
118118
- name: Azure CLI
119-
href: ../common/authorize-active-directory-cli.md?toc=%2fazure%2fstorage%2fqueues%2ftoc.json
119+
href: ../common/authorize-data-operations-cli.md?toc=%2fazure%2fstorage%2fqueues%2ftoc.json
120120
- name: Manage access rights with RBAC
121121
items:
122122
- name: Portal

0 commit comments

Comments
 (0)