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/redis/scripts/create-manage-cache.md
+40-25Lines changed: 40 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ appliesto:
15
15
16
16
# Manage an Azure Redis cache using the Azure CLI
17
17
18
-
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.
18
+
This article describes how to create and 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.
19
19
20
20
## Prerequisites
21
21
@@ -26,45 +26,44 @@ This article describes how to create or delete an Azure Redis cache instance by
26
26
>[!NOTE]
27
27
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure CLI [az redis](/cli/azure/redis) commands.
28
28
>
29
-
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the [az redisenterprise](/cli/azure/redisenterprise) commands. The `redisenterprise` extension for Azure CLI version 2.61.0 or higher automatically installs the first time you run an `az redisenterprise` command.
29
+
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the [az redisenterprise](/cli/azure/redisenterprise) commands. The `redisenterprise` extension for Azure CLI version 2.61.0 or higher prompts you for installation the first time you run an `az redisenterprise` command.
This sample is broken. When it is fixed, we can fix this include.
36
38
-->
37
-
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.
39
+
To create an Azure Managed Redis cache by using Azure CLI, the `name`, `location`, `resourceGroup`, and `sku` parameters are required. Other parameters are optional and have defaults.
38
40
39
-
>[!IMPORTANT]
40
-
>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).
41
+
You can use the Azure CLI script in this section to create an Azure Managed Redis cache with default settings. You can also use the following other methods to create a cache:
41
42
42
-
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.
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.
48
+
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.
45
49
46
50
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.
47
51
48
-
::: zone pivot="azure-managed-redis"
52
+
Microsoft Entra authentication is enabled by default for all new caches and is recommended for security.
49
53
50
-
### Create an Azure Managed Redis or Azure Redis Enterprise cache
54
+
>[!IMPORTANT]
55
+
>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).
51
56
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 other ways to create a cache:
Transport Layer Security (TLS) 1.2-1.3 encryption is enabled by default for all 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.
59
58
60
59
>[!IMPORTANT]
61
-
>You can enable or configure the following settings for Azure Managed Redis or Azure Cache for Redis Enterprise 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.
60
+
>You can enable or configure the following settings for Azure Managed Redis 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
61
>- 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
62
>- 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.
64
63
>- If you're using the cache in a geo-replication group, you can't change eviction policies after the cache is created.
65
64
>- The [RediSearch](../redis-modules.md#redisearch) module requires the Enterprise cluster policy and No Eviction eviction policy.
66
65
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.
66
+
The following 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 SKU cache in it.
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.
89
+
The following script uses the [az redisenterprise show](/cli/azure/redisenterprise#az-redisenterprise-show) and [az redisenterprise database list-keys](/cli/azure/redisenterprise/database#az-redisenterprise-database-list-keys) commands to get and display the name, hostname, ports, and keys details for the preceding cache.
90
+
91
+
>[!NOTE]
92
+
>The `list-keys` operation works only when access keys are enabled for the cache. The output of this command might compromise security by showing secrets, and may trigger a sensitive information warning. For more information, see [Use Azure CLI to manage sensitive information](https://go.microsoft.com/fwlink/?linkid=2258669).
91
93
92
94
```azurecli
93
95
# Get details of an Azure Managed Redis cache
@@ -98,7 +100,7 @@ az redisenterprise show --name "$cache" --resource-group $resourceGroup
@@ -127,18 +129,31 @@ az group delete --resource-group $resourceGroup -y
127
129
128
130
::: zone pivot="azure-cache-redis"
129
131
130
-
###Create an Azure Cache for Redis Basic, Standard, or Premium cache
132
+
## Create an Azure Cache for Redis Basic, Standard, or Premium cache
131
133
132
-
You can use the following Azure CLI script to create an Azure Cache for Redis Basic, Standard, or Premium-tier cache. To create and manage an Azure Cache for Redis Enterprise-tier cache, use the [Azure Managed Redis](create-manage-cache.md?pivots=azure-managed-redis) scripts.
134
+
You can use the following Azure CLI script to create an Azure Basic, Standard, or Premium-tier cache. To create and manage an Azure Cache for Redis Enterprise-tier cache, use the [Azure Managed Redis](create-manage-cache.md?pivots=azure-managed-redis) scripts.
133
135
134
-
You can also use the following other ways to create a cache:
136
+
To create an Azure Cache for Redis cache by using Azure CLI, the `name`, `location`, `resourceGroup`, `sku`, and `size` parameters are required. Other parameters are optional and have defaults.
137
+
138
+
You can use the Azure CLI script in this section to create an Azure Cache for Redis cache with default settings. You can also use the following other methods to create a cache:
135
139
136
140
-[Azure portal (Basic, Standard, or Premium)](../../azure-cache-for-redis/quickstart-create-redis.md)
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.
147
+
148
+
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.
149
+
150
+
Transport Layer Security (TLS) 1.2-1.3 encryption is enabled by default for all 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.
151
+
152
+
>[!IMPORTANT]
153
+
>Microsoft Entra authentication is recommended for security.
154
+
155
+
>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).
156
+
142
157
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.
143
158
144
159
```azurecli
@@ -204,4 +219,4 @@ az group delete --resource-group $resourceGroup -y
204
219
## Related content
205
220
206
221
- For more information about the Azure CLI, see the [Azure CLI documentation](/cli/azure).
207
-
- 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).
222
+
- 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