Skip to content

Commit 9ff42f3

Browse files
authored
Merge pull request #284661 from yunho-microsoft/yunho/fluidRelayRotateKeys
Add rotate key page for Azure Fluid Relay
2 parents c429d64 + e97d562 commit 9ff42f3

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

articles/azure-fluid-relay/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
href: how-tos/container-recovery.md
5151
- name: 'How to: Use audience features in the Fluid Framework'
5252
href: how-tos/use-audience-in-fluid.md
53+
- name: 'How to: Rotate Azure Fluid Relay access keys'
54+
href: how-tos/rotate-fluid-relay-access-keys.md
5355
- name: Reference
5456
items:
5557
- name: Service limits
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
description: Learn how to rotate Azure Fluid Relay access keys.
3+
title: Rotate Azure Fluid Relay access keys
4+
ms.date: 08/13/2024
5+
ms.service: azure-fluid
6+
ms.topic: reference
7+
---
8+
9+
# How to rotate Fluid Relay Server access keys
10+
This article provides an overview of managing access keys (tenant keys) in Azure Fluid Relay Service. Microsoft recommends that you regularly rotate your keys for better security.
11+
12+
## Primary / Secondary keys
13+
Customers use the access keys to sign the access tokens that are used to access Azure Fluid Relay Services. Azure Fluid Relay uses the keys to validate the tokens.
14+
15+
Two keys are associated with each Azure Fluid Relay Service: a primary key and secondary key. The purpose of dual keys is to let you regenerate, or roll, keys, providing continuous access to your account and data.
16+
17+
## View your access keys
18+
19+
### [Azure portal](#tab/azure-portal)
20+
To see your access keys, search for your Azure Fluid Relay Service in the Azure portal. On the left menu of Azure Fluid Relay Service page, select **Settings**. Then, select **Access Keys**. Select the **Copy** button to copy the selected key.
21+
22+
[![Screenshot that shows the Access Keys page.](../images/rotate-tenant-keys.png)](../images/rotate-tenant-keys.png#lightbox)
23+
24+
### [PowerShell](#tab/azure-powershell)
25+
To retrieve your access keys with PowerShell, you need to install [Azure Fluid Relay module](/powershell/module/az.fluidrelay) first.
26+
27+
```azurepowershell
28+
Install-Module Az.FluidRelay
29+
```
30+
31+
Then call the [Get-AzFluidRelayServerKey](/powershell/module/az.fluidrelay/get-azfluidrelayserverkey) command.
32+
33+
```azurepowershell
34+
Get-AzFluidRelayServerKey -FluidRelayServerName <Fluid Relay Service name> -ResourceGroup <resource group> -SubscriptionId <subscription id>
35+
```
36+
37+
### [Azure CLI](#tab/azure-cli)
38+
To retrieve your access keys with Azure CLI, you need to install [fluid-relay](/cli/azure/fluid-relay) extension first. See [instructions](/cli/azure/azure-cli-extensions-overview).
39+
40+
Then use [az fluid-relay server list-key](/cli/azure/fluid-relay/server?view=azure-cli-latest&preserve-view=true#az-fluid-relay-server-list-key) command to list access keys.
41+
42+
```azurecli
43+
az fluid-relay server list-key --resource-group <resource group> --server-name <Fluid Relay Service name>
44+
```
45+
46+
---
47+
48+
## Rotate your access keys
49+
Two access keys are assigned so that your Azure Fluid Relay Service does not have to be taken offline when you rotate a key. Having two keys ensures that your application maintains access to Azure Fluid Relay throughout the process. You should rotate one of two keys at one time to avoid service interruptions.
50+
51+
The process of rotating primary and secondary keys is the same. The following steps are for primary keys.
52+
53+
### [Azure portal](#tab/azure-portal)
54+
To rotate your Azure Fluid Relay primary key in the Azure portal:
55+
56+
1. Update the access keys in your application code to use the secondary access key for the Azure Fluid Relay.
57+
58+
2. Navigate to your Fluid Relay Service in the Azure portal.
59+
60+
3. Under **Settings**, select **Access key**.
61+
62+
4. To regenerate the primary access key for your Azure Fluid Relay Service, select the **Regenerate Primary Key** button above the Access Information.
63+
64+
5. Update the primary key in your code to reference the new primary access key.
65+
66+
### [PowerShell](#tab/azure-powershell)
67+
To rotate your Fluid Relay primary key with PowerShell, you need to install [Azure Fluid Relay module](/powershell/module/az.fluidrelay) first.
68+
69+
```azurepowershell
70+
Install-Module Az.FluidRelay
71+
```
72+
73+
Then follow steps below:
74+
75+
1. Update the access keys in your application code to use the secondary access key for the Azure Fluid Relay.
76+
77+
2. Call the [New-AzFluidRelayServerKey](/powershell/module/az.fluidrelay/new-azfluidrelayserverkey) command to regenerate the primary access key, as shown in the following example:
78+
79+
80+
```azurepowershell
81+
New-AzFluidRelayServerKey -FluidRelayServerName <Fluid Relay Service name> -ResourceGroup <resource group> -KeyName <key name>
82+
```
83+
84+
3. Update the primary key in your code to reference the new primary access key.
85+
86+
### [Azure CLI](#tab/azure-cli)
87+
To rotate your Fluid Relay primary key with Azure CLI, you need to install [fluid-relay](/cli/azure/fluid-relay) extension first. See [instructions](/cli/azure/azure-cli-extensions-overview).
88+
89+
Then follow steps below:
90+
91+
1. Update the access keys in your application code to use the secondary access key for the Azure Fluid Relay.
92+
93+
2. Call the [az fluid-relay server regenerate-key](/cli/azure/fluid-relay/server?view=azure-cli-latest&preserve-view=true#az-fluid-relay-server-regenerate-key) command to regenerate the primary access key, as shown in the following example:
94+
95+
```azurecli
96+
az fluid-relay server regenerate-key --resource-group <resource group>--server-name <Fluid Relay Service name>--key-name <key name>
97+
```
98+
99+
3. Update the primary key in your code to reference the new primary access key.
100+
101+
---
56.1 KB
Loading

0 commit comments

Comments
 (0)