Skip to content

Commit fff6132

Browse files
authored
Merge pull request #280811 from ivywei0125/yuwe/azconfig_rotate_key
[App Configuration] Add docs for key rotation
2 parents c173afa + 979f9df commit fff6132

File tree

4 files changed

+99
-22
lines changed

4 files changed

+99
-22
lines changed

articles/azure-app-configuration/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
href: concept-enable-rbac.md
212212
- name: Assign an Azure Managed Identity
213213
href: overview-managed-identity.md
214-
- name: Disable access key authentication
214+
- name: Manage access key authentication
215215
href: howto-disable-access-key-authentication.md
216216
- name: Security controls by Azure Policy
217217
href: ./security-controls-policy.md

articles/azure-app-configuration/howto-disable-access-key-authentication.md

Lines changed: 98 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,108 @@
11
---
2-
title: Disable access key authentication for an Azure App Configuration instance
2+
title: Manage access key authentication for an Azure App Configuration instance
33
titleSuffix: Azure App Configuration
4-
description: Learn how to disable access key authentication for an Azure App Configuration instance.
4+
description: Learn how to manage access key authentication for an Azure App Configuration instance.
55
ms.service: azure-app-configuration
66
author: maud-lv
77
ms.author: malev
88
ms.topic: how-to
99
ms.date: 04/05/2024
1010
---
1111

12-
# Disable access key authentication for an Azure App Configuration instance
12+
# Manage access key authentication for an Azure App Configuration instance
1313

14-
Every request to an Azure App Configuration resource must be authenticated. By default, requests can be authenticated with either Microsoft Entra credentials, or by using an access key. Of these two types of authentication schemes, Microsoft Entra ID provides superior security and ease of use over access keys, and is recommended by Microsoft. To require clients to use Microsoft Entra ID to authenticate requests, you can disable the usage of access keys for an Azure App Configuration resource.
14+
Every request to an Azure App Configuration resource must be authenticated. By default, requests can be authenticated with either Microsoft Entra credentials, or by using an access key. Of these two types of authentication schemes, Microsoft Entra ID provides superior security and ease of use over access keys, and is recommended by Microsoft. To require clients to use Microsoft Entra ID to authenticate requests, you can disable the usage of access keys for an Azure App Configuration resource. If you want to use access keys to authenticate the request, it's recommended to rotate access keys every 90 days to enhance security.
1515

16-
When you disable access key authentication for an Azure App Configuration resource, any existing access keys for that resource are deleted. Any subsequent requests to the resource using the previously existing access keys will be rejected. Only requests that are authenticated using Microsoft Entra ID will succeed. For more information about using Microsoft Entra ID, see [Authorize access to Azure App Configuration using Microsoft Entra ID](./concept-enable-rbac.md).
16+
## Enable access key authentication
1717

18-
## Disable access key authentication
19-
20-
Disabling access key authentication will delete all access keys. If any running applications are using access keys for authentication, they will begin to fail once access key authentication is disabled. Enabling access key authentication again will generate a new set of access keys and any applications attempting to use the old access keys will still fail.
18+
Access key is enabled by default, you can use access keys in your code to authenticate requests.
2119

2220
> [!WARNING]
2321
> If any clients are currently accessing data in your Azure App Configuration resource with access keys, then Microsoft recommends that you migrate those clients to [Microsoft Entra ID](./concept-enable-rbac.md) before disabling access key authentication.
2422
2523
# [Azure portal](#tab/portal)
2624

25+
To allow/disallow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
26+
27+
1. Navigate to your Azure App Configuration resource in the Azure portal.
28+
1. Locate the **Access settings** setting under **Settings**.
29+
30+
:::image type="content" border="true" source="./media/access-settings-blade.png" alt-text="Screenshot showing how to access an Azure App Configuration resources access key blade.":::
31+
32+
1. Set the **Enable access keys** toggle to **Enabled**.
33+
34+
:::image type="content" border="true" source="./media/enable-access-keys.png" alt-text="Screenshot showing how to enable access key authentication for Azure App Configuration.":::
35+
36+
# [Azure CLI](#tab/azure-cli)
37+
38+
To enable access keys for Azure App configuration resource, use the following command. The `--disable-local-auth` option is set to "false" for enable local auth.
39+
40+
```azurecli-interactive
41+
az appconfig update \
42+
--name <app-configuration-name> \
43+
--resource-group <resource-group> \
44+
--disable-local-auth false
45+
```
46+
47+
---
48+
49+
### Verify that access key authentication is enabled
50+
51+
To verify if access key authentication is enabled, check if you're able to get a list of read and read-write access keys. This list will only exist if access key authentication is enabled.
52+
53+
# [Azure portal](#tab/portal)
54+
55+
To check if access key authentication is enabled for an Azure App Configuration resource in the Azure portal, follow these steps:
56+
57+
1. Navigate to your Azure App Configuration resource in the Azure portal.
58+
1. Locate the **Access settings** setting under **Settings**.
59+
60+
:::image type="content" border="true" source="./media/access-settings-blade.png" alt-text="Screenshot showing how to access an Azure App Configuration resources access key blade.":::
61+
62+
1. Check if there are access keys displayed and if the toggled state of **Enable access keys** is enabled.
63+
64+
:::image type="content" border="true" source="./media/get-access-keys-list.png" alt-text="Screenshot showing access keys for an Azure App Configuration resource.":::
65+
66+
# [Azure CLI](#tab/azure-cli)
67+
68+
To check if access key authentication is enabled for an Azure App Configuration resource, use the following command. The command will list the access keys for an Azure App Configuration resource.
69+
If access key authentication is enabled, then read access keys and read-write access keys will be returned.
70+
71+
```azurecli-interactive
72+
az appconfig credential list \
73+
--name <app-configuration-name> \
74+
--resource-group <resource-group>
75+
```
76+
77+
---
78+
79+
## Disable access key authentication
80+
81+
Disabling access key authentication will delete all access keys. If any running applications are using access keys for authentication, they will begin to fail once access key authentication is disabled. Only requests that are authenticated using Microsoft Entra ID will succeed. For more information about using Microsoft Entra ID, see [Authorize access to Azure App Configuration using Microsoft Entra ID](./concept-enable-rbac.md). Enabling access key authentication again will generate a new set of access keys and any applications attempting to use the old access keys will still fail.
82+
83+
# [Azure portal](#tab/portal)
84+
2785
To disallow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
2886

2987
1. Navigate to your Azure App Configuration resource in the Azure portal.
30-
2. Locate the **Access settings** setting under **Settings**.
88+
1. Locate the **Access settings** setting under **Settings**.
3189

3290
:::image type="content" border="true" source="./media/access-settings-blade.png" alt-text="Screenshot showing how to access an Azure App Configuration resources access key blade.":::
3391

34-
3. Set the **Enable access keys** toggle to **Disabled**.
92+
1. Set the **Enable access keys** toggle to **Disabled**.
3593

3694
:::image type="content" border="true" source="./media/disable-access-keys.png" alt-text="Screenshot showing how to disable access key authentication for Azure App Configuration":::
3795

3896
# [Azure CLI](#tab/azure-cli)
3997

40-
The capability to disable access key authentication using the Azure CLI is in development.
98+
To disable access keys for Azure App configuration resource, use the following command. The `--disable-local-auth` option is set to "true" for disable local auth.
99+
100+
```azurecli-interactive
101+
az appconfig update \
102+
--name <app-configuration-name> \
103+
--resource-group <resource-group> \
104+
--disable-local-auth true
105+
```
41106

42107
---
43108

@@ -50,31 +115,24 @@ To verify that access key authentication is no longer permitted, a request can b
50115
To verify access key authentication is disabled for an Azure App Configuration resource in the Azure portal, follow these steps:
51116

52117
1. Navigate to your Azure App Configuration resource in the Azure portal.
53-
2. Locate the **Access settings** setting under **Settings**.
118+
1. Locate the **Access settings** setting under **Settings**.
54119

55120
:::image type="content" border="true" source="./media/access-settings-blade.png" alt-text="Screenshot showing how to access an Azure App Configuration resources access key blade.":::
56121

57-
3. Verify there are no access keys displayed and **Enable access keys** is toggled to **Disabled**.
122+
1. Check that there are no access keys displayed and the toggled state of **Enable access keys** is off.
58123

59124
:::image type="content" border="true" source="./media/disable-access-keys.png" alt-text="Screenshot showing access keys being disabled for an Azure App Configuration resource":::
60125

61126
# [Azure CLI](#tab/azure-cli)
62127

63-
To verify access key authentication is disabled for an Azure App Configuration resource in the Azure portal, use the following command. The command will list the access keys for an Azure App Configuration resource and if access key authentication is disabled the list will be empty.
128+
To verify access key authentication is disabled for an Azure App Configuration resource, use the following command. The command will list the access keys for an Azure App Configuration resource and if access key authentication is disabled the list will be empty.
64129

65130
```azurecli-interactive
66131
az appconfig credential list \
67132
--name <app-configuration-name> \
68133
--resource-group <resource-group>
69134
```
70135

71-
If access key authentication is disabled, then an empty list will be returned.
72-
73-
```
74-
C:\Users\User>az appconfig credential list -g <resource-group> -n <app-configuration-name>
75-
[]
76-
```
77-
78136
---
79137

80138
## Permissions for allowing or disallowing access key authentication
@@ -96,6 +154,25 @@ Be careful to restrict assignment of these roles only to those users who require
96154
> [!NOTE]
97155
> When access key authentication is disabled and [ARM authentication mode](./quickstart-deployment-overview.md#azure-resource-manager-authentication-mode) of App Configuration store is local, the capability to read/write key-values in an [ARM template](./quickstart-resource-manager.md) will be disabled as well. This is because access to the Microsoft.AppConfiguration/configurationStores/keyValues resource used in ARM templates requires access key authentication with local ARM authentication mode. It's recommended to use pass-through ARM authentication mode. For more information, see [Deployment overview](./quickstart-deployment-overview.md).
98156
157+
## Rotate access key
158+
Microsoft recommends that you rotate your access keys periodically to help keep your resource secure. If possible, use Azure Key Vault to manage your access keys. If you are not using Key Vault, you will need to rotate your keys manually.
159+
160+
Each Azure App Configuration resource has two access keys to enable secret rotation. This is a security precaution that lets you regularly change the keys that can access your service, protecting the privacy of your resource if a key gets leaked. The recommended rotation cycle is 90 days.
161+
162+
You can rotate keys using the following procedure:
163+
164+
1. If you're using both keys in production, change your code so that only one access key is in use. In this example, let's say you decide to keep using your store's primary key.
165+
You must have only one key in your code, because when you regenerate your secondary key, the older version of that key will stop working immediately, causing clients using the older key to get 401 access denied errors.
166+
167+
1. Once the primary key is the only key in use, you can regenerate the secondary key. Go to your resource's page on the Azure portal, open the **Settings** > **Access settings** menu, and select **Regenerate** under **Secondary key**.
168+
169+
1. Next, update your code to use the newly generated secondary key.
170+
It helps to have logs or availability to check that users of the key have successfully swapped from using the primary key to the secondary key before you proceed.
171+
172+
1. Now you can regenerate the primary key using the same process.
173+
174+
1. Finally, update your code to use the new primary key.
175+
99176
## Next steps
100177

101178
- [Use customer-managed keys to encrypt your App Configuration data](concept-customer-managed-keys.md)
10.3 KB
Loading
33.1 KB
Loading

0 commit comments

Comments
 (0)