Skip to content

Commit 5b926d2

Browse files
committed
Adding context and auth details
1 parent 19bdf16 commit 5b926d2

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

articles/storage/blobs/data-lake-storage-directory-file-acl-powershell.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,31 @@ This article shows you how to use PowerShell to create and manage directories, f
7070

7171
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
7272

73-
4. Get the storage account.
73+
### Get the storage context
7474

75-
```powershell
76-
$storageAccount = Get-AzStorageAccount -ResourceGroupName "<resource-group-name>" -AccountName "<storage-account-name>"
77-
```
75+
Choose how you want your commands obtain authorization to the storage account. Then, get the storage account context. Your commands can obtain authorization by using Azure Active Directory (AD), or by using the storage account key.
7876

79-
* Replace the `<resource-group-name>` placeholder value with the name of your resource group.
77+
#### Obtain authorization by using Azure Active Directory (AD)
8078

81-
* Replace the `<storage-account-name>` placeholder value with the name of your storage account.
79+
The system ensures that your user account has the appropriate role-based access control (RBAC) assignments and ACL permissions.
8280

83-
5. Get the storage account context.
81+
```powershell
82+
$ctx = New-AzStorageContext -StorageAccountName '<storage-account-name>' -UseConnectedAccount
83+
```
84+
Replace the `<storage-account-name>` placeholder value with the name of your storage account.
8485

85-
```powershell
86-
$ctx = $storageAccount.Context
87-
```
86+
#### Obtain authorization by using the storage account key
87+
88+
The system doesn't check the RBAC or ACL permissions of a resource.
89+
90+
```powershell
91+
$storageAccount = Get-AzStorageAccount -ResourceGroupName "<resource-group-name>" -AccountName "<storage-account-name>"
92+
$ctx = $storageAccount.Context
93+
```
94+
95+
* Replace the `<resource-group-name>` placeholder value with the name of your resource group.
96+
97+
* Replace the `<storage-account-name>` placeholder value with the name of your storage account.
8898

8999
## Create a file system
90100

0 commit comments

Comments
 (0)