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
Although access key authentication is simple, it comes with a set of challenges around security and password management. For contrast, in this article, you learn how to use a Microsoft Entra token for cache authentication.
22
23
23
-
Although access key authentication is simple, it comes with a set of challenges around security and password management. In this article, you learn how to use a Microsoft Entra token for cache authentication.
24
-
25
-
Azure Cache for Redis offers a password-free authentication mechanism by integrating with [Microsoft Entra ID](/azure/active-directory/fundamentals/active-directory-whatis). This integration also includes [role-based access control](/azure/role-based-access-control/) functionality provided through [access control lists (ACLs)](https://redis.io/docs/management/security/acl/) supported in open source Redis.
24
+
Azure Cache for Redis offers a password-free authentication mechanism by integrating with [Microsoft Entra ID (preview)](/azure/active-directory/fundamentals/active-directory-whatis). This integration also includes [role-based access control](/azure/role-based-access-control/) functionality provided through [access control lists (ACLs)](https://redis.io/docs/management/security/acl/) supported in open source Redis.
26
25
27
26
To use the ACL integration, your client application must assume the identity of a Microsoft Entra entity, like service principal or managed identity, and connect to your cache. In this article, you learn how to use your service principal or managed identity to connect to your cache, and how to grant your connection predefined permissions based on the Microsoft Entra artifact being used for the connection.
28
27
@@ -34,77 +33,74 @@ To use the ACL integration, your client application must assume the identity of
34
33
35
34
## Prerequisites and limitations
36
35
37
-
- To enable Microsoft Entra token-based authentication for your Azure Cache for Redis instance, at least one Redis user must be configured under the **Data Access Policy** setting in the Resource menu.
38
-
- Microsoft Entra ID-based authentication is supported for SSL connections and TLS 1.2 only.
39
-
- Microsoft Entra ID-based authentication isn't supported on Azure Cache for Redis instances that run Redis version 4.
36
+
- Microsoft Entra ID-based authentication is supported for SSL connections and TLS 1.2 or higher.
40
37
- Microsoft Entra ID-based authentication isn't supported on Azure Cache for Redis instances that [depend on Cloud Services](./cache-faq.yml#caches-with-a-dependency-on-cloud-services--classic).
41
38
- Microsoft Entra ID based authentication isn't supported in the Enterprise tiers of Azure Cache for Redis Enterprise.
42
39
- Some Redis commands are blocked. For a full list of blocked commands, see [Redis commands not supported in Azure Cache for Redis](cache-configure.md#redis-commands-not-supported-in-azure-cache-for-redis).
43
40
44
41
> [!IMPORTANT]
45
-
> Once a connection is established using Microsoft Entra token, client applications must periodically refresh Microsoft Entra token before expiry, and send an `AUTH` command to Redis server to avoid disruption of connections. For more information, see [Configure your Redis client to use Microsoft Entra ID](#configure-your-redis-client-to-use-azure-active-directory).
> Once a connection is established using Microsoft Entra token, client applications must periodically refresh Microsoft Entra token before expiry, and send an `AUTH` command to Redis server to avoid disruption of connections. For more information, see [Configure your Redis client to use Microsoft Entra ID](#configure-your-redis-client-to-use-microsoft-entra-id).
48
43
49
-
## Enable Microsoft Entra token based authentication on your cache
44
+
## Enable Microsoft Entra ID authentication on your cache
50
45
51
46
1. In the Azure portal, select the Azure Cache for Redis instance where you'd like to configure Microsoft Entra token-based authentication.
52
47
53
-
1. Select **(PREVIEW) Data Access Configuration** from the Resource menu.
48
+
1. Select **Authentication** from the Resource menu.
54
49
55
-
1.Select "**Add**" and choose **New Redis User**.
50
+
1.In the working pane, select **(PREVIEW) Enable Microsoft Entra Authentication**.
56
51
57
-
1.On the **Access Policy** tab, select one the available policies in the table: **Owner**, **Contributor**, or **Reader**. Then, select the **Next:Redis Users**.
52
+
1.Select **Enable Microsoft Entra Authentication**, and enter the name of a valid user. The user you enter is automatically assigned _Data Owner Access Policy_ by default when you select **Save**. You can also enter a managed identity or service principal to connect to your cache instance.
58
53
59
-
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-new-redis-user.png" alt-text="Screenshot showing the available Access Policies.":::
54
+
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-enable-microsoft-entra.png" alt-text="Screenshot showing authentication selected in the resource menu and the enable Microsoft Entra authentication checked.":::
60
55
61
-
1.Choose either the **User or service principal** or **Managed Identity** to determine how you want to use for authenticate to your Azure Cache for Redis instance.
56
+
1.A popup dialog box displays asking if you want to update your configuration, and informing you that it takes several minutes. Select **Yes.**
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-select-members.png" alt-text="Screenshot showing members to add as New Redis Users.":::
58
+
> [!IMPORTANT]
59
+
> Once the enable operation is complete, the nodes in your cache instance reboots to load the new configuration. We recommend performing this operation during your maintenance window or outside your peak business hours. The operation can take up to 30 minutes.
60
+
61
+
## Using data access configuration with your cache
62
+
63
+
If you would like to use a custom access policy instead of Redis Data Owner, go to the **Data Access Configuration** on the Resource menu. For more information, see [Configure a custom data access policy for your application](cache-configure-role-based-access-control.md#configure-a-custom-data-access-policy-for-your-application).
64
+
65
+
1. In the Azure portal, select the Azure Cache for Redis instance where you'd like to add to the Data Access Configuration.
66
+
67
+
1. Select **(PREVIEW) Data Access Configuration** from the Resource menu.
65
68
66
-
1.From the Resource menu, select **Advanced settings**.
69
+
1.Select **Add** and choose **New Redis User**.
67
70
68
-
1.Check the box labeled **(PREVIEW) Enable Microsoft Entra Authorization** and select **OK**. Then, select **Save**.
71
+
1.On the **Access Policy** tab, select one the available policies in the table: **Data Owner**, **Data Contributor**, or **Data Reader**. Then, select the **Next:Redis Users**.
69
72
70
-
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-azure-ad-access-authorization.png" alt-text="Screenshot of Microsoft Entra ID access authorization.":::
73
+
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-new-redis-user.png" alt-text="Screenshot showing the available Access Policies.":::
74
+
75
+
1. Choose either the **User or service principal** or **Managed Identity** to determine how to assign access to your Azure Cache for Redis instance. If you select **User or service principal**,and you want to add a _user_, you must first [enable Microsoft Entra Authentication](#enable-microsoft-entra-id-authentication-on-your-cache).
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-select-members.png" alt-text="Screenshot showing members to add as New Redis Users.":::
71
79
72
80
1. A dialog box displays a popup notifying you that upgrading is permanent and might cause a brief connection blip. Select **Yes.**
73
81
74
82
> [!IMPORTANT]
75
83
> Once the enable operation is complete, the nodes in your cache instance reboots to load the new configuration. We recommend performing this operation during your maintenance window or outside your peak business hours. The operation can take up to 30 minutes.
## Configure your Redis client to use Microsoft Entra ID
80
86
81
-
Because most Azure Cache for Redis clients assume that a password/access key is used for authentication, you likely need to update your client workflow to support authentication using Microsoft Entra ID. In this section, you learn how to configure your client applications to connect to Azure Cache for Redis using a Microsoft Entra token.
82
-
83
-
:::image type="content" source="media/cache-azure-active-directory-for-authentication/azure-ad-token.png" alt-text="Architecture diagram showing the flow of a token from Microsoft Entra ID to a customer application to a cache.":::
87
+
Because most Azure Cache for Redis clients assume that a password and access key are used for authentication, you likely need to update your client workflow to support authentication using Microsoft Entra ID. In this section, you learn how to configure your client applications to connect to Azure Cache for Redis using a Microsoft Entra token.
84
88
85
-
<aname='azure-ad-client-workflow'></a>
89
+
<!-- :::image type="content" source="media/cache-azure-active-directory-for-authentication/azure-ad-token.png" alt-text="Architecture diagram showing the flow of a token from Microsoft Entra ID to a customer application to a cache."::: -->
86
90
87
91
### Microsoft Entra Client Workflow
88
92
89
-
1. Configure your client application to acquire a Microsoft Entra token for scope `https://redis.azure.com/.default` or `acca5fbb-b7e4-4009-81f1-37e38fd66d78/.default` using the [Microsoft Authentication Library (MSAL)](/azure/active-directory/develop/msal-overview).
90
-
91
-
<!-- (ADD code snippet) -->
93
+
1. Configure your client application to acquire a Microsoft Entra token for scope, `https://redis.azure.com/.default` or `acca5fbb-b7e4-4009-81f1-37e38fd66d78/.default`, using the [Microsoft Authentication Library (MSAL)](/azure/active-directory/develop/msal-overview).
92
94
93
95
1. Update your Redis connection logic to use following `UserName` and `Password`:
94
96
95
-
-`UserName` = Object ID of your managed identity or service principal
96
-
97
-
-`Password` = Microsoft Entra token that you acquired using MSAL
98
-
99
-
<!-- (ADD code snippet) -->
97
+
`UserName` = Object ID of your managed identity or service principal
98
+
`Password` = Microsoft Entra token that you acquired using MSAL
100
99
101
100
1. Ensure that your client executes a Redis [AUTH command](https://redis.io/commands/auth/) automatically before your Microsoft Entra token expires using:
102
101
103
-
-`UserName` = Object ID of your managed identity or service principal
104
-
105
-
-`Password` = Microsoft Entra token refreshed periodically
106
-
107
-
<!-- (ADD code snippet) -->
102
+
`UserName` = Object ID of your managed identity or service principal
103
+
`Password` = Microsoft Entra token refreshed periodically
108
104
109
105
### Client library support
110
106
@@ -124,8 +120,6 @@ The following table includes links to code samples, which demonstrate how to con
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-configure-role-based-access-control.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ The following list contains some examples of permission strings for various scen
94
94
95
95
- Allow application to execute only _read_ commands
96
96
97
-
Permissions string: `+@read *`
97
+
Permissions string: `+@read ~*`
98
98
99
99
- Allow application to execute _read_ command category and set command on keys with prefix `Az`.
100
100
@@ -116,22 +116,22 @@ The following list contains some examples of permission strings for various scen
116
116
117
117
1.[Configure Permissions](#permissions-for-your-data-access-policy) as per your requirements.
118
118
119
-
1.From the Resource menu, select**Advanced settings**.
119
+
1.To add a user to the access policy using Microsoft Entra ID, you must first enable Microsoft Entra ID by selecting**Authentication** from the Resource menu.
120
120
121
-
1.If not checked already, Check the box labeled **(PREVIEW) Enable Microsoft Entra Authorization**and select **OK**. Then, select **Save**.
121
+
1.Select **(PREVIEW) Enable Microsoft Entra Authentication**as the tab in the working pane.
122
122
123
-
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-azure-ad-access-authorization.png" alt-text="Screenshot of Microsoft Entra ID access authorization.":::
123
+
1. If not checked already, check the box labeled **(PREVIEW) Enable Microsoft Entra Authentication** and select **OK**. Then, select **Save**.
124
124
125
-
1. A dialog box displays a popup notifying you that upgrading is permanent and might cause a brief connection blip. Select **Yes.**
125
+
:::image type="content" source="media/cache-azure-active-directory-for-authentication/cache-enable-microsoft-entra.png" alt-text="Screenshot of Microsoft Entra ID access authorization.":::
126
+
127
+
1. A popup dialog box displays asking if you want to update your configuration, and informing you that it takes several minutes. Select **Yes.**
126
128
127
129
> [!IMPORTANT]
128
130
> Once the enable operation is complete, the nodes in your cache instance reboots to load the new configuration. We recommend performing this operation during your maintenance window or outside your peak business hours. The operation can take up to 30 minutes.
## Configure your Redis client to use Microsoft Entra ID
133
133
134
-
Now that you have configured Redis User and Data access policy for configuring role based access control, you need to update your client workflow to support authenticating using a specific user/password. To learn how to configure you client application to connect to your cache instance as a specific Redis User, see [Configure your Redis client to use Azure AD.](cache-azure-active-directory-for-authentication.md#configure-your-redis-client-to-use-azure-active-directory)
134
+
Now that you have configured Redis User and Data access policy for configuring role based access control, you need to update your client workflow to support authenticating using a specific user/password. To learn how to configure your client application to connect to your cache instance as a specific Redis User, see [Configure your Redis client to use Microsoft Entra ID](cache-azure-active-directory-for-authentication.md#configure-your-redis-client-to-use-microsoft-entra-id).
0 commit comments