Skip to content

Commit b6c6933

Browse files
committed
fixes
1 parent b476ee5 commit b6c6933

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

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

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ appliesto:
1515

1616
# Manage an Azure Redis cache using the Azure CLI
1717

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.
1919

2020
## Prerequisites
2121

@@ -26,45 +26,44 @@ This article describes how to create or delete an Azure Redis cache instance by
2626
>[!NOTE]
2727
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure CLI [az redis](/cli/azure/redis) commands.
2828
>
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.
3030
31-
## Create an Azure Redis cache
31+
::: zone pivot="azure-managed-redis"
32+
33+
### Create an Azure Managed Redis cache
3234

3335
<!--
3436
:::code language="azurecli" source="~/azure_cli_scripts/redis-cache/create-cache/create-manage-cache.sh" id="FullScript":::
3537
This sample is broken. When it is fixed, we can fix this include.
3638
-->
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.
3840

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:
4142

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.
43+
- [Azure portal](../quickstart-create-managed-redis.md)
44+
- [Azure PowerShell](../how-to-manage-redis-cache-powershell.md?pivots=azure-managed-redis)
45+
- [ARM template](../redis-cache-arm-provision.md#azure-managed-redis-preview)
46+
- [Bicep template](../redis-cache-bicep-provision.md#azure-managed-redis-preview)
4347

44-
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.
4549

4650
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.
4751

48-
::: zone pivot="azure-managed-redis"
52+
Microsoft Entra authentication is enabled by default for all new caches and is recommended for security.
4953

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).
5156
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:
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)
57+
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.
5958

6059
>[!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.
6261
>- 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.
6362
>- 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.
6463
>- If you're using the cache in a geo-replication group, you can't change eviction policies after the cache is created.
6564
>- The [RediSearch](../redis-modules.md#redisearch) module requires the Enterprise cluster policy and No Eviction eviction policy.
6665
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.
6867

6968
```azurecli
7069
@@ -87,7 +86,10 @@ az redisenterprise create --name $cache --resource-group $resourceGroup --locati
8786

8887
## Get details for an Azure Managed Redis cache
8988

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.
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).
9193
9294
```azurecli
9395
# Get details of an Azure Managed Redis cache
@@ -98,7 +100,7 @@ az redisenterprise show --name "$cache" --resource-group $resourceGroup
98100
redis=($(az redisenterprise show --name "$cache" --resource-group $resourceGroup --query [hostName,enableNonSslPort,port,sslPort] --output tsv))
99101
100102
# Retrieve the keys for an Azure Redis Cache instance
101-
keys=($(az redisenterprise list-keys --name "$cache" --resource-group $resourceGroup --query [primaryKey,secondaryKey] --output tsv))
103+
keys=($(az redisenterprise database list-keys --cluster-name "$cache" --resource-group $resourceGroup --query [primaryKey,secondaryKey] --output tsv))
102104
103105
# Display the retrieved hostname, keys, and ports
104106
echo "Hostname:" ${redis[0]}
@@ -127,18 +129,31 @@ az group delete --resource-group $resourceGroup -y
127129

128130
::: zone pivot="azure-cache-redis"
129131

130-
### Create an Azure Cache for Redis Basic, Standard, or Premium cache
132+
## Create an Azure Cache for Redis Basic, Standard, or Premium cache
131133

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.
133135

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:
135139

136140
- [Azure portal (Basic, Standard, or Premium)](../../azure-cache-for-redis/quickstart-create-redis.md)
137141
- [Azure portal (Enterprise)](../../azure-cache-for-redis/quickstart-create-redis-enterprise.md)
138142
- [Azure PowerShell](../how-to-manage-redis-cache-powershell.md?pivots=azure-cache-redis)
139143
- [ARM template](../redis-cache-arm-provision.md#azure-cache-for-redis)
140144
- [Bicep template](../redis-cache-bicep-provision.md#azure-cache-for-redis)
141145

146+
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+
142157
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.
143158

144159
```azurecli
@@ -204,4 +219,4 @@ az group delete --resource-group $resourceGroup -y
204219
## Related content
205220

206221
- 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

Comments
 (0)