Skip to content

Commit 1a1f2ae

Browse files
Add CLI example
1 parent 8124298 commit 1a1f2ae

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

articles/storage/blobs/assign-azure-role-data-access.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,18 @@ az role assignment create \
145145
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>/blobServices/default/containers/<container-name>"
146146
```
147147

148-
For information about assigning roles with PowerShell at the subscription, resource group, or storage account scope, see [Assign Azure roles using Azure CLI](../../role-based-access-control/role-assignments-cli.md).
148+
The following example assigns the **Storage Blob Data Reader** role to a user by specifying the object ID. To learn more about the `--assignee-object-id` and `--assignee-principal-type` parameters, see [az role assignment](/cli/azure/role/assignment). In this example, the role assignment is scoped to the level of the storage account. Make sure to replace the sample values and the placeholder values in brackets (`<>`) with your own values:
149+
150+
<!-- replaycheck-task id="66526dae" -->
151+
```azurecli-interactive
152+
az role assignment create \
153+
--role "Storage Blob Data Reader" \
154+
--assignee-object-id "ab12cd34-ef56-ab12-cd34-ef56ab12cd34" \
155+
--assignee-principal-type "User" \
156+
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>"
157+
```
158+
159+
For information about assigning roles with Azure CLI at the subscription, resource group, or storage account scope, see [Assign Azure roles using Azure CLI](../../role-based-access-control/role-assignments-cli.md).
149160

150161
# [Template](#tab/template)
151162

0 commit comments

Comments
 (0)