Skip to content

Commit 1622303

Browse files
authored
Merge pull request #311037 from flang-msft/fxl---toc-reconciliation
Fxl---toc-reconciliation
2 parents 0055b0e + a18387f commit 1622303

11 files changed

Lines changed: 702 additions & 53 deletions

articles/azure-cache-for-redis/.openpublishing.redirection.redis-cache.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,6 @@
436436
"redirect_url": "/azure/redis/quickstart-create-managed-redis",
437437
"redirect_document_id": true
438438
},
439-
{
440-
"source_path_from_root": "/articles/azure-cache-for-redis/scripts/create-manage-cache.md",
441-
"redirect_url": "/azure/redis/scripts/create-manage-cache",
442-
"redirect_document_id": true
443-
},
444439
{
445440
"source_path_from_root": "/articles/azure-cache-for-redis/quickstart-create-redis-enterprise.md",
446441
"redirect_url": "/azure/redis/quickstart-create-managed-redis",

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

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,20 @@
1414
- name: Create an Azure Cache for Redis instance in the Basic, Standard and Premium tiers
1515
href: quickstart-create-redis.md
1616
- name: Create and manage with Azure PowerShell
17-
href: /azure/redis/how-to-manage-redis-cache-powershell
17+
href: how-to-manage-redis-cache-powershell.md
1818
- name: Create and manage with Azure CLI
19-
href: /azure/redis/scripts/create-manage-cache?pivots=azure-cache-redis
19+
href: scripts/create-manage-cache.md
2020
- name: Create and manage premium cache with Azure CLI
2121
href: scripts/create-manage-premium-cache-cluster.md
2222
- name: Create Redis cache - Bicep
2323
displayName: ARM, Resource Manager, Template
24-
href: /azure/redis/redis-cache-bicep-provision
24+
href: redis-cache-bicep-provision.md
2525
- name: Create Redis cache - ARM template
2626
displayName: Resource Manager
27-
href: /azure/redis/redis-cache-arm-provision
28-
29-
- name: Use a cache
30-
expanded: false
31-
items:
32-
- name: ASP.NET app
33-
href: /azure/redis/web-app-cache-howto
34-
- name: ASP.NET Core app
35-
href: /azure/redis/web-app-aspnet-core-howto
36-
- name: .NET Core app
37-
href: /azure/redis/dotnet-core-quickstart
38-
- name: .NET app
39-
href: /azure/redis/dotnet-how-to-use-azure-redis-cache
27+
href: redis-cache-arm-provision.md
4028
- name: Java app
4129
href: /azure/redis/java-get-started
42-
- name: Node.js app
43-
href: /azure/redis/nodejs-get-started
44-
- name: Python app
45-
href: /azure/redis/python-get-started
46-
- name: Go app
47-
href: /azure/redis/go-get-started
48-
49-
30+
5031
- name: Migration
5132
expanded: true
5233
items:
@@ -78,7 +59,7 @@
7859
- name: Caching architecture
7960
href: /azure/architecture/best-practices/caching?toc=/azure/redis-cache/toc.json
8061
- name: Create and manage with Azure PowerShell
81-
href: /azure/redis/how-to-manage-redis-cache-powershell
62+
href: how-to-manage-redis-cache-powershell.md
8263
- name: Connect an AKS application to a cache
8364
href: /azure/redis/tutorial-aks-get-started
8465
- name: Use Azure CLI

articles/azure-cache-for-redis/how-to-manage-redis-cache-powershell.md

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Deploy Azure Cache for Redis by using Azure Resource Manager template
3+
description: Learn how to use an Azure Resource Manager template (ARM template) to deploy an Azure Cache for Redis resource. Templates are provided for common scenarios.
4+
ms.date: 05/18/2025
5+
ms.topic: conceptual
6+
ms.custom:
7+
- subject-armqs
8+
- devx-track-arm-template
9+
- ignite-2024
10+
- build-2025
11+
appliesto:
12+
- ✅ Azure Cache for Redis
13+
---
14+
15+
# Quickstart: Create an Azure Cache for Redis using an ARM template
16+
17+
Learn how to create an Azure Resource Manager template (ARM template) that deploys an Azure Cache for Redis. The cache can be used with an existing storage account to keep diagnostic data. You also learn how to define which resources are deployed and how to define parameters that are specified when the deployment is executed. You can use this template for your own deployments, or customize it to meet your requirements. Currently, diagnostic settings are shared for all caches in the same region for a subscription. Updating one cache in the region affects all other caches in the region.
18+
19+
[!INCLUDE [About Azure Resource Manager](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-introduction.md)]
20+
21+
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template will open in the Azure portal.
22+
23+
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cache%2Fredis-cache%2Fazuredeploy.json":::
24+
25+
## Prerequisites
26+
27+
* **Azure subscription**: If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn) before you begin.
28+
* **A storage account**: To create one, see [Create an Azure Storage account](../storage/common/storage-account-create.md?tabs=azure-portal). The storage account is used for diagnostic data.
29+
30+
## Azure Cache for Redis
31+
32+
### Review the template
33+
34+
The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/redis-cache/).
35+
36+
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.cache/redis-cache-microsoft-entra-authentication/azuredeploy.json":::
37+
38+
The following resources are defined in the template:
39+
40+
* [Microsoft.Cache/Redis](/azure/templates/microsoft.cache/redis)
41+
* [Microsoft.Insights/diagnosticsettings](/azure/templates/microsoft.insights/diagnosticsettings)
42+
43+
Resource Manager templates for the new [Premium tier](../azure-cache-for-redis/cache-overview.md#service-tiers) are also available.
44+
45+
* [Create a Premium Azure Cache for Redis with clustering](https://azure.microsoft.com/resources/templates/redis-premium-cluster-diagnostics/)
46+
* [Create Premium Azure Cache for Redis with data persistence](https://azure.microsoft.com/resources/templates/redis-premium-persistence/)
47+
* [Create Premium Redis Cache deployed into a Virtual Network](https://azure.microsoft.com/resources/templates/redis-premium-vnet/)
48+
49+
To check for the latest templates, see [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/) and search for _Azure Cache for Redis_.
50+
51+
### Deploy the template
52+
53+
1. Select the following image to sign in to Azure and open the template.
54+
55+
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cache%2Fredis-cache%2Fazuredeploy.json":::
56+
57+
1. Select or enter the following values:
58+
59+
* **Subscription**: select an Azure subscription used to create the data share and the other resources.
60+
* **Resource group**: select **Create new** to create a new resource group or select an existing resource group.
61+
* **Location**: select a location for the resource group. The storage account and the Redis cache must be in the same region. By default the Redis cache uses the same location as the resource group. So, specify the same location as the storage account.
62+
* **Redis Cache Name**: enter a name for the Redis cache.
63+
* **Existing Diagnostics Storage Account**: enter the resource ID of a storage account. The syntax is `/subscriptions/<SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.Storage/storageAccounts/<STORAGE ACCOUNT NAME>`.
64+
65+
Use the default value for the rest of the settings.
66+
67+
1. Select **I agree to the terms and conditions stated above**, and the select **Purchase**.
68+
69+
## Review deployed resources
70+
71+
1. Sign in to the [Azure portal](https://portal.azure.com).
72+
1. Open the Redis cache that you created.
73+
74+
## Clean up resources
75+
76+
When no longer needed, delete the resource group, which deletes the resources in the resource group.
77+
78+
```azurepowershell-interactive
79+
$resourceGroupName = Read-Host -Prompt "Enter the resource group name"
80+
Remove-AzResourceGroup -Name $resourceGroupName
81+
Write-Host "Press [ENTER] to continue..."
82+
```
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Deploy Azure Cache for Redis using Bicep
3+
description: Learn how to use Bicep to deploy an Azure Cache for Redis resource.
4+
ms.date: 05/18/2025
5+
ms.topic: conceptual
6+
ms.custom:
7+
- subject-armqs
8+
- devx-track-bicep
9+
- ignite-2024
10+
- build-2025
11+
appliesto:
12+
- ✅ Azure Cache for Redis
13+
---
14+
15+
# Quickstart: Create an Azure Cache for Redis using Bicep
16+
17+
Learn how to use Bicep to deploy a cache using Azure Cache for Redis. After you deploy the cache, use it with an existing storage account to keep diagnostic data. Learn how to define which resources are deployed and how to define parameters that are specified when the deployment is executed. You can use this Bicep file for your own deployments, or customize it to meet your requirements.
18+
19+
[!INCLUDE [About Bicep](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-bicep-introduction.md)]
20+
21+
## Prerequisites
22+
23+
- **Azure subscription**: If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn) before you begin.
24+
- **A storage account**: To create one, see [Create an Azure Storage account](../storage/common/storage-account-create.md?tabs=azure-portal). The storage account is used for diagnostic data. Create the storage account in a new resource group named **exampleRG**.
25+
26+
## Azure Cache for Redis
27+
28+
### Review the Bicep file
29+
The Bicep file used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates//).
30+
31+
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.cache/redis-cache-microsoft-entra-authentication/main.bicep":::
32+
33+
The following resources are defined in the Bicep file:
34+
35+
* [Microsoft.Cache/Redis](/azure/templates/microsoft.cache/redis)
36+
* [Microsoft.Insights/diagnosticsettings](/azure/templates/microsoft.insights/diagnosticsettings)
37+
38+
### Deploy the Azure Cache for Redis Bicep file
39+
40+
1. Save the Bicep file as **main.bicep** to your local computer.
41+
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
42+
43+
# [CLI](#tab/CLI)
44+
45+
```azurecli
46+
az deployment group create --resource-group exampleRG --template-file main.bicep --parameters existingDiagnosticsStorageAccountName=<storage-name> existingDiagnosticsStorageAccountResourceGroup=<resource-group>
47+
```
48+
49+
# [PowerShell](#tab/PowerShell)
50+
51+
```azurepowershell
52+
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -existingDiagnosticsStorageAccountName "<storage-name>" -existingDiagnosticsStorageAccountResourceGroup "<resource-group>"
53+
```
54+
55+
---
56+
57+
> [!NOTE]
58+
> Replace **\<storage-name\>** with the name of the storage account you created at the beginning of this quickstart. Replace **\<resource-group\>** with the name of the resource group name in which your storage account is located.
59+
60+
When the deployment finishes, you see a message indicating the deployment succeeded.
61+
62+
## Review deployed resources
63+
64+
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
65+
66+
# [CLI](#tab/CLI)
67+
68+
```azurecli-interactive
69+
az resource list --resource-group exampleRG
70+
```
71+
72+
# [PowerShell](#tab/PowerShell)
73+
74+
```azurepowershell-interactive
75+
Get-AzResource -ResourceGroupName exampleRG
76+
```
77+
78+
---
79+
80+
## Clean up resources
81+
82+
When no longer needed, delete the resource group, which deletes the resources in the resource group.
83+
84+
# [CLI](#tab/CLI)
85+
86+
```azurecli-interactive
87+
az group delete --name exampleRG
88+
```
89+
90+
# [PowerShell](#tab/PowerShell)
91+
92+
```azurepowershell-interactive
93+
Remove-AzResourceGroup -Name exampleRG
94+
```
95+
96+
---
97+
98+
## Related content
99+
100+
- Learn more about [ARM templates](/azure/azure-resource-manager/templates/overview)
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Create, query, and delete a cache using Azure CLI
3+
description: Use the Azure CLI to create an Azure Cache for Redis instance, get cache details like status, hostname, ports, and keys, and delete the cache.
4+
ms.devlang: azurecli
5+
ms.topic: sample
6+
ms.date: 05/18/2025
7+
ms.custom:
8+
- devx-track-azurecli, ignite-2024, build-2025
9+
- build-2025
10+
appliesto:
11+
- ✅ Azure Cache for Redis
12+
---
13+
14+
# Manage an Azure Redis cache using the Azure CLI
15+
16+
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.
17+
18+
## Prerequisites
19+
20+
- [!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
21+
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
22+
- Make sure you're signed in to Azure with the subscription you want to create your cache under. To use a different subscription than the one you're signed in with, run `az account set -s <subscriptionId>`, replacing `<subscriptionId>` with the subscription ID you want to use.
23+
24+
>[!IMPORTANT]
25+
>Use these scripts to create and manage Azure Cache for Redis Basic, Standard, and Premium tiers with the Azure CLI [az redis](/cli/azure/redis) commands.
26+
>
27+
>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.
28+
>
29+
>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.
30+
31+
## Create an Azure Cache for Redis cache
32+
33+
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.
34+
35+
To create an Azure Cache for Redis Basic, Standard, or Premium cache by using Azure CLI, the `name`, `location`, `resourceGroup`, `sku`, and `size` parameters are required. Other parameters are optional and have defaults.
36+
37+
You can use the Azure CLI script in this section to create an Azure Cache for Redis Basic cache with default settings. You can also use the following other methods to create a cache:
38+
39+
- [Azure portal (Basic, Standard, or Premium)](../../azure-cache-for-redis/quickstart-create-redis.md)
40+
- [Azure PowerShell](../how-to-manage-redis-cache-powershell.md?pivots=azure-cache-redis)
41+
- [ARM template](../redis-cache-arm-provision.md#azure-cache-for-redis)
42+
- [Bicep template](../redis-cache-bicep-provision.md#azure-cache-for-redis)
43+
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.
45+
46+
The `location` should be an Azure region near other services that use your cache.
47+
48+
Choose a [sku](https://azure.microsoft.com/pricing/details/cache/) and `size` that have the appropriate features and performance for your cache.
49+
50+
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.
51+
52+
>[!IMPORTANT]
53+
>Microsoft Entra authentication is recommended for security. You can enable Microsoft Entra Authentication during or after cache creation.
54+
>
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).
56+
57+
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.
58+
59+
```azurecli
60+
61+
# Variable block
62+
let "randomIdentifier=$RANDOM*$RANDOM"
63+
location="East US"
64+
resourceGroup="redis-cache-rg-$randomIdentifier"
65+
tag="create-manage-cache"
66+
cache="redis-cache-$randomIdentifier"
67+
sku="basic"
68+
size="C0"
69+
70+
# Create a resource group
71+
echo "Creating $resourceGroup in "$location"..."
72+
az group create --resource-group $resourceGroup --location "$location" --tags $tag
73+
74+
# Create a Basic C0 (256 MB) Azure Redis cache
75+
echo "Creating $cache"
76+
az redis create --name $cache --resource-group $resourceGroup --location "$location" --sku $sku --vm-size $size
77+
```
78+
79+
## Get details for an Azure Cache for Redis cache
80+
81+
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.
82+
83+
>[!IMPORTANT]
84+
>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).
85+
86+
```azurecli
87+
88+
# Get details of an Azure Cache for Redis cache
89+
echo "Showing details of $cache"
90+
az redis show --name "$cache" --resource-group $resourceGroup
91+
92+
# Retrieve the hostname and ports for an Azure Redis instance
93+
redis=($(az redis show --name "$cache" --resource-group $resourceGroup --query [hostName,enableNonSslPort,port,sslPort] --output tsv))
94+
95+
# Retrieve the keys for an Azure Redis instance
96+
keys=($(az redis list-keys --name "$cache" --resource-group $resourceGroup --query [primaryKey,secondaryKey] --output tsv))
97+
98+
# Display the retrieved hostname, keys, and ports
99+
echo "Hostname:" ${redis[0]}
100+
echo "Non SSL Port:" ${redis[2]}
101+
echo "Non SSL Port Enabled:" ${redis[1]}
102+
echo "SSL Port:" ${redis[3]}
103+
echo "Primary Key:" ${keys[0]}
104+
echo "Secondary Key:" ${keys[1]}
105+
```
106+
107+
## Clean up resources
108+
109+
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.
110+
111+
```azurecli
112+
# Delete an Azure Redis cache
113+
echo "Deleting $cache"
114+
az redis delete --name "$cache" --resource-group $resourceGroup -y
115+
116+
# echo "Deleting all resources"
117+
az group delete --resource-group $resourceGroup -y
118+
```
119+
120+
## Related content
121+
122+
- [Azure CLI documentation](/cli/azure)
123+
- [Create a Premium Azure Cache for Redis with clustering](../../azure-cache-for-redis/scripts/create-manage-premium-cache-cluster.md)

articles/redis/TOC.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ items:
3131
href: dotnet-core-quickstart.md
3232
- name: .NET app
3333
href: dotnet-how-to-use-azure-redis-cache.md
34-
- name: Java app
35-
href: java-get-started.md
3634
- name: Node.js app
3735
href: nodejs-get-started.md
3836
- name: Python app
@@ -84,7 +82,7 @@ items:
8482
- name: Monitor using diagnostic settings
8583
href: monitor-diagnostic-settings.md
8684
- name: List of Redis metrics
87-
href: ../azure-cache-for-redis/monitor-cache-reference.md#metrics
85+
href: monitor-cache-reference.md#metrics
8886
- name: Scaling and performance
8987
items:
9088
- name: Change the size and tier of a cache

0 commit comments

Comments
 (0)