Skip to content

Commit 12b6cb3

Browse files
committed
add PS commands for using account encryption key
1 parent ba3c534 commit 12b6cb3

File tree

2 files changed

+59
-18
lines changed

2 files changed

+59
-18
lines changed

articles/storage/common/account-encryption-key-create.md

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 01/10/2020
10+
ms.date: 02/04/2020
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -31,37 +31,57 @@ You can create a storage account that relies on the account encryption key for Q
3131

3232
### Register to use the account encryption key
3333

34-
To register with Azure CLI, call the [az feature register](/cli/azure/feature#az-feature-register) command.
34+
To register to use the account encryption key with Queue or Table storage, use PowerShell or Azure CLI.
3535

36-
To register to use the account encryption key with Queue storage:
36+
# [PowerShell](#tab/powershell)
3737

38-
```azurecli
39-
az feature register --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForQueues
38+
To register with PowerShell, call the [Get-AzProviderFeature](/powershell/module/az.resources/get-azproviderfeature) command.
39+
40+
```powershell
41+
Register-AzProviderFeature -ProviderNamespace Microsoft.Storage -FeatureName AllowAccountEncryptionKeyForQueues
42+
Register-AzProviderFeature -ProviderNamespace Microsoft.Storage -FeatureName AllowAccountEncryptionKeyForTables
4043
```
4144

42-
To register to use the account encryption key with Table storage:
45+
# [Azure CLI](#tab/azure-cli)
46+
47+
To register with Azure CLI, call the [az feature register](/cli/azure/feature#az-feature-register) command.
4348

4449
```azurecli
50+
az feature register --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForQueues
4551
az feature register --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForTables
4652
```
4753

54+
---
55+
4856
### Check the status of your registration
4957

50-
To check the status of your registration for Queue storage:
58+
To check the status of your registration for Queue or Table storage, use PowerShell or Azure CLI.
5159

52-
```azurecli
53-
az feature show --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForQueues
60+
# [PowerShell](#tab/powershell)
61+
62+
To check the status of your registration with PowerShell, call the [Get-AzProviderFeature](/powershell/module/az.resources/get-azproviderfeature) command.
63+
64+
```powershell
65+
Get-AzProviderFeature -ProviderNamespace Microsoft.Storage -FeatureName AllowAccountEncryptionKeyForQueues
66+
Get-AzProviderFeature -ProviderNamespace Microsoft.Storage -FeatureName AllowAccountEncryptionKeyForTables
5467
```
5568

56-
To check the status of your registration for Table storage:
69+
# [Azure CLI](#tab/azure-cli)
70+
71+
To check the status of your registration with Azure CLI, call the [az feature](/cli/azure/feature#az-feature-show).
5772

5873
```azurecli
74+
az feature show --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForQueues
5975
az feature show --namespace Microsoft.Storage --name AllowAccountEncryptionKeyForTables
6076
```
6177

78+
---
79+
6280
### Re-register the Azure Storage resource provider
6381

64-
After your registration is approved, you must re-register the Azure Storage resource provider. Call the [az provider register](/cli/azure/provider#az-provider-register) command:
82+
After your registration is approved, you must re-register the Azure Storage resource provider.
83+
84+
Call the [az provider register](/cli/azure/provider#az-provider-register) command:
6585

6686
```azurecli
6787
az provider register --namespace 'Microsoft.Storage'
@@ -76,7 +96,28 @@ The storage account must be of type general-purpose v2. You can create the stora
7696
> [!NOTE]
7797
> Only Queue and Table storage can be optionally configured to encrypt data with the account encryption key when the storage account is created. Blob storage and Azure Files always use the account encryption key to encrypt data.
7898
79-
### [Azure CLI](#tab/azure-cli)
99+
# [PowerShell](#tab/powershell)
100+
101+
To use PowerShell to create a storage account that relies on the account encryption key, make sure you have installed the Azure PowerShell module, version 3.4.0 or later. For more information, see [Install the Azure PowerShell module](/powershell/azure/install-az-ps).
102+
103+
Next, create a general-purpose v2 storage account by calling the [New-AzStorageAccount](/powershell/module/az.storage/new-azstorageaccount) command, with the appropriate parameters:
104+
105+
- Include the `-EncryptionKeyTypeForQueue` option and set its value to `Account` to use the account encryption key to encrypt data in Queue storage.
106+
- Include the `-EncryptionKeyTypeForTable` option and set its value to `Account` to use the account encryption key to encrypt data in Table storage.
107+
108+
The following example shows how to create a general-purpose v2 storage account that is configured for read-access geo-redundant storage (RA-GRS) and that uses the account encryption key to encrypt data for both Queue and Table storage. Remember to replace the placeholder values in brackets with your own values:
109+
110+
```powershell
111+
New-AzStorageAccount -ResourceGroupName <resource_group> `
112+
-AccountName <storage-account> `
113+
-Location <location> `
114+
-SkuName "Standard_RAGRS" `
115+
-Kind StorageV2 `
116+
-EncryptionKeyTypeForTable Account `
117+
-EncryptionKeyTypeForQueue Account
118+
```
119+
120+
# [Azure CLI](#tab/azure-cli)
80121

81122
To use Azure CLI to create a storage account that relies on the account encryption key, make sure you have installed Azure CLI version 2.0.80 or later. For more information, see [Install the Azure CLI](/cli/azure/install-azure-cli).
82123

@@ -85,22 +126,22 @@ Next, create a general-purpose v2 storage account by calling the [az storage acc
85126
- Include the `--encryption-key-type-for-queue` option and set its value to `Account` to use the account encryption key to encrypt data in Queue storage.
86127
- Include the `--encryption-key-type-for-table` option and set its value to `Account` to use the account encryption key to encrypt data in Table storage.
87128

88-
The following example shows how to create a general-purpose v2 storage account that is configured for LRS and that uses the account encryption key to encrypt data for both Queue and Table storage. Remember to replace the placeholder values in brackets with your own values:
129+
The following example shows how to create a general-purpose v2 storage account that is configured for read-access geo-redundant storage (RA-GRS) and that uses the account encryption key to encrypt data for both Queue and Table storage. Remember to replace the placeholder values in brackets with your own values:
89130

90131
```azurecli
91132
az storage account create \
92133
--name <storage-account> \
93134
--resource-group <resource-group> \
94135
--location <location> \
95-
--sku Standard_LRS \
136+
--sku Standard_RAGRS \
96137
--kind StorageV2 \
97138
--encryption-key-type-for-table Account \
98139
--encryption-key-type-for-queue Account
99140
```
100141

101-
### [Template](#tab/template)
142+
# [Template](#tab/template)
102143

103-
The following JSON example creates a general-purpose v2 storage account that is configured for LRS and that uses the account encryption key to encrypt data for both Queue and Table storage. Remember to replace the placeholder values in angle brackets with your own values:
144+
The following JSON example creates a general-purpose v2 storage account that is configured for read-access geo-redundant storage (RA-GRS) and that uses the account encryption key to encrypt data for both Queue and Table storage. Remember to replace the placeholder values in angle brackets with your own values:
104145

105146
```json
106147
"resources": [
@@ -112,7 +153,7 @@ The following JSON example creates a general-purpose v2 storage account that is
112153
"dependsOn": [],
113154
"tags": {},
114155
"sku": {
115-
"name": "[parameters('Standard_LRS')]"
156+
"name": "[parameters('Standard_RAGRS')]"
116157
},
117158
"kind": "[parameters('StorageV2')]",
118159
"properties": {

articles/storage/common/storage-service-encryption.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: storage
55
author: tamram
66

77
ms.service: storage
8-
ms.date: 01/10/2020
8+
ms.date: 02/04/2020
99
ms.topic: conceptual
1010
ms.author: tamram
1111
ms.reviewer: cbrooks

0 commit comments

Comments
 (0)