Skip to content

Commit 435d6a7

Browse files
YunhoYunho
authored andcommitted
add powershell section
1 parent 6c9542e commit 435d6a7

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

articles/azure-fluid-relay/concepts/customer-managed-keys.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,39 @@ Notes:
8383
- Properties.encryption.customerManagedKeyEncryption.keyEncryptionKeyIdentity.userAssignedIdentityResourceId is the resource ID of the user assigned identity that should be used for CMK. Notice that it should be one of the identities in Identity.userAssignedIdentities (You must assign the identity to Fluid Relay resource before it can use it for CMK). Also, it should have necessary permissions on the key (provided by keyEncryptionKeyUrl).
8484
- Properties.encryption.customerManagedKeyEncryption.keyEncryptionKeyUrl is the key identifier used for CMK.
8585

86+
### [PowerShell](#tab/azure-powershell)
87+
You need to install [Azure Fluid Relay module](/powershell/module/az.fluidrelay) first.
88+
89+
```azurepowershell
90+
Install-Module Az.FluidRelay
91+
```
92+
93+
And make sure you complete all the prerequsite steps.
94+
95+
Example of creating a Fluid Relay Service with CMK enabled:
96+
```azurepowershell
97+
New-AzFluidRelayServer -Name <Fluid Relay Service name> -ResourceGroup <resource group name> -SubscriptionId "<subscription id>" -Location "<region>" -KeyEncryptionKeyIdentityType UserAssigned -KeyEncryptionKeyIdentityUserAssignedIdentityResourceId "<user assigned resource id>" -CustomerManagedKeyEncryptionKeyUrl "<key URL>" -UserAssignedIdentity "<user assigned resource id>"
98+
```
99+
100+
For more information about the command, see [New-AzFluidRelayServer](/powershell/module/az.fluidrelay/new-azfluidrelayserver)
101+
102+
**Notes:**
103+
104+
- The `KeyEncryptionKeyIdentityType` **must be** `UserAssigned` since `SystemAssigned` identity is not supported for CMK. It indicates the identity type to be used for Customer-Managed Key (CMK) encryption.
105+
- While multiple identities can be specified in the `UserAssignedIdentity` argument, **only** the identity defined in `KeyEncryptionKeyIdentityUserAssignedIdentityResourceId` is used to access the Key Vault for CMK encryption.
106+
- The `KeyEncryptionKeyIdentityUserAssignedIdentityResourceId` field should be set to the **resource ID** of the user-assigned identity intended for CMK access.
107+
- This identity must already be listed in the `UserAssignedIdentity` field.
108+
- Additionally, it needs the necessary permissions on the key specified in `CustomerManagedKeyEncryptionKeyUrl`.
109+
- `CustomerManagedKeyEncryptionKeyUrl` is the **key identifier** used for CMK.
110+
86111
### [Azure CLI](#tab/azure-cli)
87112
To create Fluid Relay with CMK enabled using Azure CLI, you need to install [fluid-relay](/cli/azure/fluid-relay) extension first. See [instructions](/cli/azure/azure-cli-extensions-overview).
88113

89114
And make sure you complete all the prerequsite steps.
90115

116+
Example of creating a Fluid Relay Service with CMK enabled:
91117
```azurecli
92-
az fluid-relay server create --server-name <Fluid Relay Service name> --resource-group <resource group name> --identity '{"type":"UserAssigned","user-assigned-identities":{"<user assigned resource id>":{}}}' --key-identity '{"identity-type":"UserAssigned","user-assigned-identities":"<user assigned resource id>"}' --key-url "https://akv-cuseuap-cmktest-02.vault.azure.net/keys/key-rsa-4096/81b15c848e874aabb6f13839b43b16fc" --location <location> --sku <standard or basic>
118+
az fluid-relay server create --server-name <Fluid Relay Service name> --resource-group <resource group name> --identity '{"type":"UserAssigned","user-assigned-identities":{"<user assigned resource id>":{}}}' --key-identity '{"identity-type":"UserAssigned","user-assigned-identities":"<user assigned resource id>"}' --key-url "<key URL>" --location <location> --sku <standard or basic>
93119
```
94120

95121
For more information about the command, see [az fluid-relay server create](/cli/azure/fluid-relay/server?view=azure-cli-latest#az-fluid-relay-server-create)
@@ -102,7 +128,6 @@ For more information about the command, see [az fluid-relay server create](/cli/
102128
- While multiple identities can be specified in the `identity` argument, **only** the identity defined in `key-identity` is used to access the Key Vault for CMK encryption.
103129
- The `user-assigned-identities` field under `key-identity` should be set to the **resource ID** of the user-assigned identity intended for CMK access.
104130
- This identity must already be listed in the `identity` field.
105-
- It must also be assigned to the Fluid Relay resource **before** it can be used for CMK.
106131
- Additionally, it needs the necessary permissions on the key specified in `key-url`.
107132
- `key-url` is the **key identifier** used for CMK.
108133

@@ -144,6 +169,27 @@ Request payload example for updating key encryption key URL:
144169
}
145170
```
146171

172+
### [PowerShell](#tab/azure-powershell)
173+
You need to install [Azure Fluid Relay module](/powershell/module/az.fluidrelay) first.
174+
175+
```azurepowershell
176+
Install-Module Az.FluidRelay
177+
```
178+
179+
During an update, you only need to provide the parameters that need to be changed.
180+
181+
Update encryption key URL
182+
```azurepowershell
183+
Update-AzFluidRelayServer -Name <Fluid Relay Service name> -ResourceGroup <resource group name> -SubscriptionId "<subscription id>" -CustomerManagedKeyEncryptionKeyUrl "<new key URL>"
184+
```
185+
186+
Update assigned identity for CMK
187+
```azurepowershell
188+
Update-AzFluidRelayServer -Name <Fluid Relay Service name> -ResourceGroup <resource group name> -SubscriptionId "<subscription id>" -KeyEncryptionKeyIdentityUserAssignedIdentityResourceId "<new user assigned resource id>"
189+
```
190+
191+
For more information about the command, see [Update-AzFluidRelayServer](/powershell/module/az.fluidrelay/update-azfluidrelayserver)
192+
147193
### [Azure CLI](#tab/azure-cli)
148194

149195
Update encryption key URL

0 commit comments

Comments
 (0)