You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-disable-access-key-authentication.md
+33-18Lines changed: 33 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,15 @@ ms.date: 04/05/2024
11
11
12
12
# Manage access key authentication for an Azure App Configuration instance
13
13
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.
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 periodically to enhance security. See [recommendations for protecting application secrets](/azure/well-architected/security/application-secrets) to learn more.
15
15
16
16
## Enable access key authentication
17
17
18
18
Access key is enabled by default, you can use access keys in your code to authenticate requests.
19
19
20
-
> [!WARNING]
21
-
> 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.
22
-
23
20
# [Azure portal](#tab/portal)
24
21
25
-
To allow/disallow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
22
+
To allow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
26
23
27
24
1. Navigate to your Azure App Configuration resource in the Azure portal.
28
25
1. Locate the **Access settings** setting under **Settings**.
@@ -35,7 +32,7 @@ To allow/disallow access key authentication for an Azure App Configuration resou
35
32
36
33
# [Azure CLI](#tab/azure-cli)
37
34
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.
35
+
To enable access keys for Azure App configuration resource, use the following command. The `--disable-local-auth` option is set to `false` to enable access key-based authentication.
39
36
40
37
```azurecli-interactive
41
38
az appconfig update \
@@ -48,7 +45,7 @@ az appconfig update \
48
45
49
46
### Verify that access key authentication is enabled
50
47
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.
48
+
To verify if access key authentication is enabled, check if you're able to get a list of read-only and read-write access keys. This list will only exist if access key authentication is enabled.
52
49
53
50
# [Azure portal](#tab/portal)
54
51
@@ -66,7 +63,7 @@ To check if access key authentication is enabled for an Azure App Configuration
66
63
# [Azure CLI](#tab/azure-cli)
67
64
68
65
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.
66
+
If access key authentication is enabled, then read-only access keys and read-write access keys will be returned.
70
67
71
68
```azurecli-interactive
72
69
az appconfig credential list \
@@ -80,6 +77,9 @@ az appconfig credential list \
80
77
81
78
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
79
80
+
> [!WARNING]
81
+
> 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.
82
+
83
83
# [Azure portal](#tab/portal)
84
84
85
85
To disallow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
@@ -95,7 +95,7 @@ To disallow access key authentication for an Azure App Configuration resource in
95
95
96
96
# [Azure CLI](#tab/azure-cli)
97
97
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.
98
+
To disable access keys for Azure App configuration resource, use the following command. The `--disable-local-auth` option is set to `true` to disable access key-based authentication.
99
99
100
100
```azurecli-interactive
101
101
az appconfig update \
@@ -154,24 +154,39 @@ Be careful to restrict assignment of these roles only to those users who require
154
154
> [!NOTE]
155
155
> 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).
156
156
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.
157
+
## Access key rotation
158
+
Microsoft recommends periodic rotation of access keys to mitigate the risk of attack vectors from leaked secrets. Each Azure App Configuration resource includes two read-only access keys and two read-write access keys, designated as primary and secondary keys, to facilitate seamless secret rotation. This setup enables you to alternate access keys in your applications without causing any downtime.
161
159
162
160
You can rotate keys using the following procedure:
163
161
164
162
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
163
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
164
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**.
165
+
1. Once the primary key is the only key in use, you can regenerate the secondary key.
168
166
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.
167
+
### [Azure portal](#tab/portal)
171
168
172
-
1. Now you can regenerate the primary key using the same process.
169
+
Go to your resource's page on the Azure portal, open the **Settings** > **Access settings** menu, and select **Regenerate** under **Secondary key**.
To regenerate an access key for an App Configuration store, use the following command.
176
+
177
+
```azurecli-interactive
178
+
az appconfig credential regenerate \
179
+
--name <app-configuration-name> \
180
+
--resource-group <resource-group> \
181
+
--id <key-to-be-regenerated>
182
+
```
183
+
184
+
---
185
+
186
+
1. Next, update your code to use the newly generated secondary key.
187
+
It is advisable to review your application logs to confirm that all instances of your application have transitioned from using the primary key to the secondary key before proceeding to the next step.
173
188
174
-
1. Finally, update your code to use the new primary key.
189
+
1. Finally, you can invalidate the primary keys by regenerating them. Next time, you can alternate access keys between the secondary and primary keys using the same process.
0 commit comments