title | description | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Provision an Azure Cache for Redis using Azure Resource Manager | Microsoft Docs |
Use Azure Resource Manager template to deploy an Azure Cache for Redis. |
app-service |
wesmc7777 |
cfowler |
ce6f5372-7038-4655-b1c5-108f7c148282 |
cache |
web |
azure-cache-for-redis |
na |
article |
01/23/2017 |
wesmc |
In this topic, you learn how to create an Azure Resource Manager 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.
For more information about creating templates, see Authoring Azure Resource Manager Templates.
For the complete template, see Azure Cache for Redis template.
Note
Resource Manager templates for the new Premium tier are available.
- Create a Premium Azure Cache for Redis with clustering
- Create Premium Azure Cache for Redis with data persistence
- Create Premium Azure Cache for Redis with VNet and optional clustering
To check for the latest templates, see Azure Quickstart Templates and search for Azure Cache for Redis
.
In this template, you will deploy an Azure Cache for Redis that uses an existing storage account for diagnostic data.
To run the deployment automatically, click the following button:
With Azure Resource Manager, you define parameters for values you want to specify when the template is deployed. The template includes a section called Parameters that contains all of the parameter values. You should define a parameter for those values that vary based on the project you are deploying or based on the environment you are deploying to. Do not define parameters for values that always stay the same. Each parameter value is used in the template to define the resources that are deployed.
[!INCLUDE app-service-web-deploy-redis-parameters]
The location of the Azure Cache for Redis. For best performance, use the same location as the app to be used with the cache.
"redisCacheLocation": {
"type": "string"
}
The name of the existing storage account to use for diagnostics.
"existingDiagnosticsStorageAccountName": {
"type": "string"
}
A boolean value that indicates whether to allow access via non-SSL ports.
"enableNonSslPort": {
"type": "bool"
}
A value that indicates whether diagnostics is enabled. Use ON or OFF.
"diagnosticsStatus": {
"type": "string",
"defaultValue": "ON",
"allowedValues": [
"ON",
"OFF"
]
}
Creates the Azure Cache for Redis.
{
"apiVersion": "2015-08-01",
"name": "[parameters('redisCacheName')]",
"type": "Microsoft.Cache/Redis",
"location": "[parameters('redisCacheLocation')]",
"properties": {
"enableNonSslPort": "[parameters('enableNonSslPort')]",
"sku": {
"capacity": "[parameters('redisCacheCapacity')]",
"family": "[parameters('redisCacheFamily')]",
"name": "[parameters('redisCacheSKU')]"
}
},
"resources": [
{
"apiVersion": "2017-05-01-preview",
"type": "Microsoft.Cache/redis/providers/diagnosticsettings",
"name": "[concat(parameters('redisCacheName'), '/Microsoft.Insights/service')]",
"location": "[parameters('redisCacheLocation')]",
"dependsOn": [
"[concat('Microsoft.Cache/Redis/', parameters('redisCacheName'))]"
],
"properties": {
"status": "[parameters('diagnosticsStatus')]",
"storageAccountName": "[parameters('existingDiagnosticsStorageAccountName')]"
}
}
]
}
[!INCLUDE app-service-deploy-commands]
New-AzureRmResourceGroupDeployment -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-redis-cache/azuredeploy.json -ResourceGroupName ExampleDeployGroup -redisCacheName ExampleCache
azure group deployment create --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-redis-cache/azuredeploy.json -g ExampleDeployGroup