Skip to content

Commit f2ff714

Browse files
authored
Merge pull request #184902 from flang-msft/fxl---Managed-Identity-Docs-Page
Fxl---managed identity docs page
2 parents 2cc14c2 + 2586c5d commit f2ff714

20 files changed

+203
-4
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ AzureMigration.ps1
2323
!/.vscode/extensions.json
2424
.gitignore
2525
**/.vscode/settings.json
26-
27-
desktop.ini
26+
*.pdn
27+
articles/azure-cache-for-redis/media/cache-managed-identity/Screenshot 2022-01-20 092913.pdn

articles/azure-cache-for-redis/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
href: cache-how-to-version.md
107107
- name: Distribute your cache with clustering
108108
href: cache-how-to-premium-clustering.md
109+
- name: Managed identity with Azure Cache for Redis
110+
href: cache-managed-identity.md
109111
- name: Persist your cache with Redis data persistence
110112
href: cache-how-to-premium-persistence.md
111113
- name: Add more replicas
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
---
2+
title: Managed Identity
3+
titleSuffix: Azure Cache for Redis
4+
description: Learn to Azure Cache for Redis
5+
author: flang-msft
6+
ms.service: cache
7+
ms.topic: conceptual
8+
ms.date: 01/21/2022
9+
ms.author: franlanglois
10+
---
11+
12+
# Managed identity with Azure Cache for Redis (Preview)
13+
14+
[Managed identities](/azure/active-directory/managed-identities-azure-resources/overview) are a common tool used in Azure to help developers minimize the burden of managing secrets and login information. Managed identities are useful when Azure services connect to each other. Instead of managing authorization between each service, [Azure Active Directory](/azure/active-directory/fundamentals/active-directory-whatis) (Azure AD) can be used to provide a managed identity that makes the authentication process more streamlined and secure.
15+
16+
## Managed identity with storage accounts
17+
18+
Azure Cache for Redis can use a managed identity to connect with a storage account, useful in two scenarios:
19+
20+
- [Data Persistence](cache-how-to-premium-persistence.md)--scheduled backups of data in your cache through an RDB or AOF file.
21+
22+
- [Import or Export](cache-how-to-import-export-data.md)--saving snapshots of cache data or importing data from a saved file.
23+
24+
Managed identity lets you simplify the process of securely connecting to your chosen storage account for these tasks.
25+
26+
> [!NOTE]
27+
> This functionality does not yet support authentication for connecting to a cache instance.
28+
>
29+
30+
Azure Cache for Redis supports [both types of managed identity](/azure/active-directory/managed-identities-azure-resources/overview):
31+
32+
- **System-assigned identity** is specific to the resource. In this case, the cache is the resource. When the cache is deleted, the identity is deleted.
33+
34+
- **User-assigned identity** is specific to a user, not the resource. It can be assigned to any resource that supports managed identity and remains even when you delete the cache.
35+
36+
Each type of managed identity has advantages, but in Azure Cache for Redis, the functionality is the same.
37+
38+
### Enable managed identity
39+
40+
Managed identity can be enabled either when you create a cache instance or after the cache has been created. During the creation of a cache, only a system-assigned identity can be assigned. Either identity type can be added to an existing cache.
41+
42+
### Prerequisites and limitations
43+
44+
To use managed identity, you must have a premium-tier cache.
45+
46+
## Create a new cache with managed identity using the portal
47+
48+
1. Sign into the [Azure portal](https://portal.azure.com/)
49+
50+
1. Create a new Azure Cache for Redis resource with a **Cache type** of any of the premium tiers. Complete **Basics** tab with all the required information.
51+
> [!NOTE]
52+
> Managed identity functionality is only available in the Premium tier.
53+
>
54+
:::image type="content" source="media/cache-managed-identity/basics.png" alt-text="create a premium azure cache":::
55+
56+
1. Click the **Advanced** tab. Then, scroll down to **(PREVIEW) System assigned managed identity** and select **On**.
57+
58+
:::image type="content" source="media/cache-managed-identity/system-assigned.png" alt-text="Advanced page of the form":::
59+
60+
1. Complete the creation process. Once the cache has been created and deployed, open it, and select the **(PREVIEW) Identity** tab under the **Settings** section on the left.
61+
62+
:::image type="content" source="media/cache-managed-identity/identity-resource.png" alt-text="(Preview) Identity in the Resource menu":::
63+
64+
1. You see that a system-assigned **object ID** has been assigned to the cache **Identity**.
65+
66+
:::image type="content" source="media/cache-managed-identity/user-assigned.png" alt-text="System assigned resource settings for identity":::
67+
68+
## Add system assigned identity to an existing cache
69+
70+
1. Navigate to your Azure Cache for Redis resource from the Azure portal. Select **(PREVIEW) Identity** from the Resource menu on the left.
71+
> [!NOTE]
72+
> Managed identity functionality is only available in the Premium tier.
73+
>
74+
75+
1. To enable a system-assigned identity, select the **System assigned (preview)** tab, and select **On** under **Status**. Select **Save** to confirm.
76+
77+
:::image type="content" source="media/cache-managed-identity/identity-save.png" alt-text="System assigned identity status is on":::
78+
79+
1. A dialog pops up saying that your cache will be registered with Azure Active Directory and that it can be granted permissions to access resources protected by Azure AD. Select **Yes**.
80+
81+
1. You see an **Object (principal) ID**, indicating that the identity has been assigned.
82+
83+
:::image type="content" source="media/cache-managed-identity/user-assigned.png" alt-text="new Object principal ID shown for system assigned identity":::
84+
85+
## Add a user assigned identity to an existing cache
86+
87+
1. Navigate to your Azure Cache for Redis resource from the Azure portal. Select **(PREVIEW) Identity** from the Resource menu on the left.
88+
> [!NOTE]
89+
> Managed identity functionality is only available in the Premium tier.
90+
>
91+
92+
1. To enable user assigned identity, select the **User assigned (preview)** tab and select **Add**.
93+
94+
:::image type="content" source="media/cache-managed-identity/identity-add.png" alt-text="User assigned identity status is on":::
95+
96+
1. A sidebar pops up to allow you to select any available user-assigned identity to your subscription. Choose an identity and select **Add**. For more information on user assigned managed identities, see [manage user-assigned identity](/azure/active-directory/managed-identities-azure-resources/manage-user-assigned-managed-identities.md).
97+
>[!Note]
98+
>You need to [create a user assigned identity](/azure/active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp) in advance of this step.
99+
>
100+
:::image type="content" source="media/cache-managed-identity/choose-identity.png" alt-text="new Object principal ID shown for user assigned identity":::
101+
102+
1. You see the user-assigned identity listed in the **User assigned (preview)** pane.
103+
104+
:::image type="content" source="media/cache-managed-identity/identity-list.png" alt-text="list of identity names":::
105+
106+
## Enable managed identity using the Azure CLI
107+
108+
Use the Azure CLI for creating a new cache with managed identity or updating an existing cache to use managed identity. For more information, see [az redis create](/cli/azure/redis?view=azure-cli-latest.md) or [az redis identity](/cli/azure/redis/identity?view=azure-cli-latest).
109+
110+
For example, to update a cache to use system-managed identity use the following CLI command:
111+
112+
```azurecli-interactive
113+
114+
az redis identity assign \--mi-system-assigned \--name MyCacheName \--resource-group MyResource Group
115+
```
116+
117+
## Enable managed identity using Azure PowerShell
118+
119+
Use Azure PowerShell for creating a new cache with managed identity or updating an existing cache to use managed identity. For more information, see [New-AzRedisCache](/powershell/module/az.rediscache/new-azrediscache?view=azps-7.1.0) or [Set-AzRedisCache](/powershell/module/az.rediscache/set-azrediscache?view=azps-7.1.0).
120+
121+
For example, to update a cache to use system-managed identity, use the following PowerShell command:
122+
123+
```powershell-interactive
124+
Set-AzRedisCache -ResourceGroupName \"MyGroup\" -Name \"MyCache\" -IdentityType "SystemAssigned"
125+
```
126+
127+
## Configure storage account to use managed identity
128+
129+
> [!IMPORTANT]
130+
> Managed identity must be configured in the storage account before Azure Cache for Redis can access the account for persistence or import/export functionality. If this step is not done correctly, you see errors or no data written.
131+
132+
1. Create a new storage account or open an existing storage account that you would like to connect to your cache instance.
133+
134+
2. Open the **Access control (IAM)** from the Resource menu. Then, select **Add**, and **Add role assignment**.
135+
136+
:::image type="content" source="media/cache-managed-identity/demo-storage.png" alt-text="access control (iam) settings":::
137+
138+
3. Search for the **Storage Blob Data Contributor** on the Role pane. Select it and **Next**.
139+
140+
:::image type="content" source="media/cache-managed-identity/role-assignment.png" alt-text="add role assignment form with list of roles":::
141+
142+
4. Select the **Members** tab. Under **Assign access to** select **Managed Identity**, and select on **Select members**. A sidebar pops up on the right.
143+
144+
:::image type="content" source="media/cache-managed-identity/select-members.png" alt-text="add role assignment form with members pane":::
145+
146+
5. Use the drop-down under **Managed Identity** to choose either a **User-assigned managed identity** or a **System-assigned managed identity**. If you have many managed identities, you can search by name. Choose the managed identities you want and then **Select**. Then, **Review + assign** to confirm.
147+
148+
:::image type="content" source="media/cache-managed-identity/review-assign.png" alt-text="select managed identities form pop up":::
149+
150+
6. You can confirm if the identity has been assigned successfully by checking your storage account's role assignments under **Storage Blob Data Contributor**.
151+
152+
:::image type="content" source="media/cache-managed-identity/blob-data.png" alt-text="storag blob data contributor list":::
153+
154+
> [!NOTE]
155+
> Adding an Azure Cache for Redis instance as a storage blog data contributor through system-assigned identity will conveniently add the cache instance to the [trusted services list](/azure/storage/common/storage-network-security?tabs=azure-portal), making firewall exceptions easier to implement.
156+
157+
## Use managed identity to access a storage account
158+
159+
### Use managed identity with data persistence
160+
161+
1. Open the Azure Cache for Redis instance that has been assigned the Storage Blob Data Contributor role and go to the **Data persistence** on the Resource menu.
162+
163+
2. Change the **Authentication Method** to **(PREVIEW) Managed Identity** and select the storage account you configured above. select **Save**.
164+
165+
:::image type="content" source="media/cache-managed-identity/data-persistence.png" alt-text="data persistence pane with authentication method selected":::
166+
167+
> [!IMPORTANT]
168+
> The identity defaults to the system-assigned identity if it is enabled. Otherwise, the first listed user-assigned identity is used.
169+
>
170+
171+
3. Data persistence backups can now be saved to the storage account using managed identity authentication.
172+
173+
:::image type="content" source="media/cache-managed-identity/redis-persistence.png" alt-text="export data in resource menu":::
174+
175+
### Use managed identity to import and export cache data
176+
177+
1. Open your Azure Cache for Redis instance that has been assigned the Storage Blob Data Contributor role and go to the **Import** or **Export** tab under **Administration**.
178+
179+
2. If importing data, choose the blob storage location that holds your chosen RDB file. If exporting data, type your desired blob name prefix and storage container. In both situations, you must use the storage account you've configured for managed identity access.
180+
181+
:::image type="content" source="media/cache-managed-identity/export-data.png" alt-text="export data from the resource menu":::
182+
183+
3. Under **Authentication Method**, choose **(PREVIEW) Managed Identity** and select **Import** or **Export**, respectively.
184+
185+
> [!NOTE]
186+
> It will take a few minutes to import or export the data.
187+
>
188+
189+
> [!IMPORTANt]
190+
>If you see an export or import failure, double check that your storage account has been configured with your cache's system-assigned or user-assigned identity. The identity used will default to system-assigned identity if it is enabled. Otherwise, the first listed user-assigned identity is used.
191+
192+
## Next steps
193+
194+
- [Learn more](cache-overview.md#service-tiers) about Azure Cache for Redis features
195+
- [What are managed identifies](/azure/active-directory/managed-identities-azure-resources/overview)

articles/azure-cache-for-redis/index.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ landingContent:
3232
url: https://azure.microsoft.com/resources/videos/azure-redis-cache-administration-options/
3333
- linkListType: whats-new
3434
links:
35+
- text: Managed identity with Azure Cache for Redis
36+
url: cache-managed-identity.md
3537
- text: Create an Enterprise tier cache
3638
url: quickstart-create-redis-enterprise.md
37-
- text: Frequently asked questions
38-
url: cache-faq.yml
39+
# - text: Frequently asked questions
40+
# url: cache-faq.yml
3941
- title: 'Quickstarts: Azure Cache for Redis'
4042
linkLists:
4143
- linkListType: quickstart
55 KB
Loading
78.7 KB
Loading
68.8 KB
Loading
68.9 KB
Loading
71.5 KB
Loading
52 KB
Loading

0 commit comments

Comments
 (0)