Skip to content

Commit 9b7a859

Browse files
committed
edits
1 parent ea7e58b commit 9b7a859

File tree

1 file changed

+40
-21
lines changed

1 file changed

+40
-21
lines changed

articles/redis/scripts/create-manage-cache.md

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@ description: Use the Azure CLI to create an Azure Redis instance, get cache deta
55

66
ms.devlang: azurecli
77
ms.topic: sample
8-
ms.date: 05/05/2025
8+
ms.date: 05/06/2025
99
zone_pivot_groups: redis-type
1010
ms.custom: devx-track-azurecli, ignite-2024
1111
appliesto:
1212
- ✅ Azure Managed Redis
1313
- ✅ Azure Cache for Redis
1414
---
1515

16-
# Create an Azure Redis cache using the Azure CLI
16+
# Manage an Azure Redis cache using the Azure CLI
1717

1818
This article describes how to create or delete an Azure Redis cache instance by using the Azure CLI. The article also shows how to use the Azure CLI to get cache details including provisioning status, hostname, ports, and keys.
1919

20+
>[!NOTE]
21+
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure CLI [az redis](/cli/azure/redis) commands. To manage Azure Cache for Redis Basic, Standard, or Premium instances, select the **Azure Cache for Redis** option at the top of this article and use the `az redis` commands.
22+
>
23+
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the [az redisenterprise](/cli/azure/redisenterprise) commands. The commands are part of the `redisenterprise` extension for Azure CLI version 2.61.0 or higher, which automatically installs the first time you run an `az redisenterprise` command.
24+
>
25+
>To manage Azure Cache for Redis Enterprise or Azure Managed Redis instances, select the **Azure Managed Redis** option at the top of this article and use the `az redisenterprise` commands.
26+
2027
## Prerequisites
2128

2229
- [!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
@@ -29,30 +36,35 @@ This article describes how to create or delete an Azure Redis cache instance by
2936
:::code language="azurecli" source="~/azure_cli_scripts/redis-cache/create-cache/create-manage-cache.sh" id="FullScript":::
3037
This sample is broken. When it is fixed, we can fix this include.
3138
-->
32-
The cache `name` must be a string of 1-63 characters that's unique in the [Azure region](https://azure.microsoft.com/regions/). The name can contain only numbers, letters, and hyphens, must start and end with a number or letter, and can't contain consecutive hyphens.
33-
34-
The `location` should be an Azure region near other services that use your cache. Use a [sku](https://azure.microsoft.com/pricing/details/cache/) and `size` that have the appropriate features and performance for your cache.
35-
36-
Microsoft Entra authentication is enabled by default for new caches, and access keys authentication is disabled. You can enable access key authentication during or after cache creation, but for security and ease of use, Microsoft Entra authentication is recommended.
39+
Microsoft Entra authentication is enabled by default for new caches, and access keys authentication is disabled. You can enable access key authentication during or after cache creation, but Microsoft Entra authentication is recommended for better security.
3740

3841
>[!IMPORTANT]
3942
>Use Microsoft Entra ID with managed identities to authorize requests against your cache if possible. Authorization using Microsoft Entra ID and managed identity provides better security and is easier to use than shared access key authorization. For more information about using managed identities with your cache, see [Use Microsoft Entra ID for cache authentication](../../azure-cache-for-redis/cache-azure-active-directory-for-authentication.md).
4043
4144
Transport Layer Security (TLS) 1.2-1.3 encryption is enabled by default for new caches. You can enable the non-TLS port and connections during or after cache creation, but for security reasons, disabling TLS isn't recommended.
4245

46+
The cache `name` must be a string of 1-63 characters that's unique in the [Azure region](https://azure.microsoft.com/regions/). The name can contain only numbers, letters, and hyphens, must start and end with a number or letter, and can't contain consecutive hyphens.
47+
48+
The `location` should be an Azure region near other services that use your cache. Choose a [sku](https://azure.microsoft.com/pricing/details/cache/) that has the appropriate features and performance for your cache.
49+
4350
::: zone pivot="azure-managed-redis"
4451

52+
You can use the following Azure CLI script to create an Azure Managed Redis or Azure Cache for Redis Enterprise cache. You can also use the following methods to create a cache:
53+
54+
- [Azure portal (Azure Managed Redis)](../quickstart-create-managed-redis.md)
55+
- [Azure portal (Azure Cache for Redis Enterprise)](../../azure-cache-for-redis/quickstart-create-redis-enterprise.md)
56+
- [Azure PowerShell](../how-to-manage-redis-cache-powershell.md?pivots=azure-managed-redis)
57+
- [ARM template](../redis-cache-arm-provision.md#azure-managed-redis-preview)
58+
- [Bicep template](../redis-cache-bicep-provision.md#azure-managed-redis-preview)
59+
4560
>[!IMPORTANT]
46-
>You can enable or configure the following settings only at Azure Managed Redis cache creation time. Gather the information you need to configure these settings before you begin, and make sure to configure them correctly during cache creation.
47-
>- You must enable modules at the time you create the cache instance. You can't change modules or enable module configuration after you create a cache.
48-
>- Azure Managed Redis supports two clustering policies: Enterprise or OSS. You can't change the clustering policy after you create the cache.
61+
>You can enable or configure the following settings only at cache creation time. Gather the information you need to configure these settings in advance, and make sure to configure them correctly during cache creation.
62+
>- You can enable modules only at the time you create the cache. You can't change modules or enable module configuration after you create a cache.
63+
>- Azure Managed Redis and Azure Cache for Redis Enterprise tiers support two clustering policies: Enterprise or OSS. You can't change the clustering policy after you create the cache.
4964
>- If you're using the cache in a geo-replication group, you can't change eviction policies after the cache is created.
5065
>- The [RediSearch](../redis-modules.md#redisearch) module requires the Enterprise cluster policy and No Eviction eviction policy.
5166
52-
The following script uses the [az group create](/cli/azure/group) and [az redisenterprise create](/cli/azure/redisenterprise#az-redisenterprise-create) commands to create a resource group and create an Azure Managed Redis Balanced B1 cache in the resource group.
53-
54-
>[!NOTE]
55-
>The [az redisenterprise](/cli/azure/redisenterprise) commands are part of the `redisenterprise` extension for the Azure CLI, version 2.61.0 or higher. The extension automatically installs the first time you run an `az redisenterprise` command.
67+
This script sets variables, and then uses the [az group create](/cli/azure/group) and [az redisenterprise create](/cli/azure/redisenterprise#az-redisenterprise-create) commands to create a resource group with an Azure Managed Redis Balanced B1 cache in it.
5668

5769
```azurecli
5870
@@ -75,7 +87,7 @@ az redisenterprise create --name $cache --resource-group $resourceGroup --locati
7587

7688
## Get details for an Azure Managed Redis cache
7789

78-
The following script uses the [az redisenterprise show](/cli/azure/redisenterprise#az-redisenterprise-show) and [az redisenterprise list-keys](/cli/azure/redisenterprise#az-redisenterprise-list-keys) commands to get and display cache name, hostname, ports, and keys details.
90+
The following script uses the [az redisenterprise show](/cli/azure/redisenterprise#az-redisenterprise-show) and [az redisenterprise list-keys](/cli/azure/redisenterprise#az-redisenterprise-list-keys) commands to get and display the name, hostname, ports, and keys details for the preceding cache.
7991

8092
```azurecli
8193
# Get details of an Azure Managed Redis cache
@@ -100,7 +112,7 @@ echo "Secondary Key:" ${keys[1]}
100112

101113
## Clean up resources
102114

103-
The following script uses the [az group delete](/cli/azure/group) and [az redisenterprise delete](/cli/azure/redisenterprise#az-redisenterprise-delete) commands to delete a cache, and then delete the resource group that contains all cache resources.
115+
The following script uses the [az group delete](/cli/azure/group) and [az redisenterprise delete](/cli/azure/redisenterprise#az-redisenterprise-delete) commands to delete the preceding cache, and then delete its resource group.
104116

105117
```azurecli
106118
# Delete a redis cache
@@ -115,7 +127,15 @@ az group delete --resource-group $resourceGroup -y
115127

116128
::: zone pivot="azure-cache-redis"
117129

118-
The following script uses the [az group create](/cli/azure/group) and [az redis create](/cli/azure/redis#az-redis-create) commands to create a resource group and create an Azure Cache for Redis Basic C0 cache in the resource group.
130+
You can use the following Azure CLI script to create an Azure Cache for Redis Basic, Standard, or Premium-tier cache. To create an Enterprise-tier cache, use the [Azure Managed Redis](create-managed-cache.md?pivots=azure-managed-redis) script. You can also use the following methods to create a cache:
131+
132+
- [Azure portal (Basic, Standard, or Premium)](../../azure-cache-for-redis/quickstart-create-redis.md)
133+
- [Azure portal (Enterprise)](../../azure-cache-for-redis/quickstart-create-redis-enterprise.md)
134+
- [Azure PowerShell](../how-to-manage-redis-cache-powershell.md?pivots=azure-cache-redis)
135+
- [ARM template](../redis-cache-arm-provision.md#azure-cache-for-redis)
136+
- [Bicep template](../redis-cache-bicep-provision.md#azure-cache-for-redis)
137+
138+
The following script uses the [az group create](/cli/azure/group) and [az redis create](/cli/azure/redis#az-redis-create) commands to create a resource group with an Azure Cache for Redis Basic C0 cache in it.
119139

120140
```azurecli
121141
@@ -139,7 +159,7 @@ az redis create --name $cache --resource-group $resourceGroup --location "$locat
139159

140160
## Get details for an Azure Cache for Redis cache
141161

142-
The following script uses the [az redis show](/cli/azure/redis#az-redis-show) and [az redis list-keys](/cli/azure/redis#az-redis-list-keys) commands to get and display name, hostname, ports, and keys details.
162+
The following script uses the [az redis show](/cli/azure/redis#az-redis-show) and [az redis list-keys](/cli/azure/redis#az-redis-list-keys) commands to get and display the name, hostname, ports, and keys details for the preceding cache.
143163

144164
```azurecli
145165
@@ -164,7 +184,7 @@ echo "Secondary Key:" ${keys[1]}
164184

165185
## Clean up resources
166186

167-
The following script uses the [az group delete](/cli/azure/group) and [az redis delete](/cli/azure/redis#az-redis-delete) commands to delete a cache, and then delete the resource group that contains all cache resources.
187+
The following script uses the [az group delete](/cli/azure/group) and [az redis delete](/cli/azure/redis#az-redis-delete) commands to delete the preceding cache, and then delete its resource group.
168188

169189
```azurecli
170190
# Delete an Azure Redis cache
@@ -173,12 +193,11 @@ az redis delete --name "$cache" --resource-group $resourceGroup -y
173193
174194
# echo "Deleting all resources"
175195
az group delete --resource-group $resourceGroup -y
176-
177196
```
178197

179198
::: zone-end
180199

181200
## Related content
182201

183202
- For more information about the Azure CLI, see the [Azure CLI documentation](/cli/azure).
184-
- For an Azure Managed Redis CLI script sample that creates an Azure Managed Redis cache with clustering, see [Azure Managed Redis with clustering](../../azure-cache-for-redis/scripts/create-manage-premium-cache-cluster.md).
203+
- For an Azure CLI script sample that creates an Azure Cache for Redis Premium cache with clustering, see [Create a Premium Azure Cache for Redis with clustering](../../azure-cache-for-redis/scripts/create-manage-premium-cache-cluster.md).

0 commit comments

Comments
 (0)