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
+98-21Lines changed: 98 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,108 @@
1
1
---
2
-
title: Disable access key authentication for an Azure App Configuration instance
2
+
title: Manage access key authentication for an Azure App Configuration instance
3
3
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.
5
5
ms.service: azure-app-configuration
6
6
author: maud-lv
7
7
ms.author: malev
8
8
ms.topic: how-to
9
9
ms.date: 04/05/2024
10
10
---
11
11
12
-
# Disable access key authentication for an Azure App Configuration instance
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.
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.
15
15
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
17
17
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.
21
19
22
20
> [!WARNING]
23
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.
24
22
25
23
# [Azure portal](#tab/portal)
26
24
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
+
27
85
To disallow access key authentication for an Azure App Configuration resource in the Azure portal, follow these steps:
28
86
29
87
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**.
31
89
32
90
:::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.":::
33
91
34
-
3. Set the **Enable access keys** toggle to **Disabled**.
92
+
1. Set the **Enable access keys** toggle to **Disabled**.
35
93
36
94
:::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":::
37
95
38
96
# [Azure CLI](#tab/azure-cli)
39
97
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
+
```
41
106
42
107
---
43
108
@@ -50,31 +115,24 @@ To verify that access key authentication is no longer permitted, a request can b
50
115
To verify access key authentication is disabled for an Azure App Configuration resource in the Azure portal, follow these steps:
51
116
52
117
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**.
54
119
55
120
:::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.":::
56
121
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.
58
123
59
124
:::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":::
60
125
61
126
# [Azure CLI](#tab/azure-cli)
62
127
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.
64
129
65
130
```azurecli-interactive
66
131
az appconfig credential list \
67
132
--name <app-configuration-name> \
68
133
--resource-group <resource-group>
69
134
```
70
135
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
-
78
136
---
79
137
80
138
## 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
96
154
> [!NOTE]
97
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).
98
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.
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
+
99
176
## Next steps
100
177
101
178
-[Use customer-managed keys to encrypt your App Configuration data](concept-customer-managed-keys.md)
0 commit comments