Redis cache should use Availability zones in supported regions#
Reliability · Azure Cache for Redis · Rule · 2021_12 · Important
Premium Redis cache should be deployed with availability zones for high availability.
Description#
Redis Cache using availability zones improve reliability and ensure availability during failure scenarios affecting a data center within a region. Nodes in one availability zone are physically separated from nodes defined in another availability zone. By spreading node pools across multiple zones, nodes in one node pool will continue running even if another zone has gone down.
Recommendation#
Consider using availability zones for Premium Redis Cache deployed in supported regions.
Examples#
Configure with Azure template#
To set availability zones for Premium SKU Redis Cache:
- Set
zones
to a minimum of two zones from["1", "2", "3"]
. - Set
Properties.replicasPerMaster
to number of zones - 1, to ensure you have at least as many nodes as zones you are replicating to. - Set
Properties.sku.name
toPremium
. - Set
Properties.sku.family
toP
. - Set
Properties.sku.capacity
to one of[1, 2, 3, 4, 5]
, depending on the SKU you picked:P1
- 6 GBP2
- 13 GBP3
- 26 GBP4
- 53 GBP5
- 120 GB
For example:
{
"type": "Microsoft.Cache/redis",
"apiVersion": "2024-03-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"redisVersion": "6",
"sku": {
"name": "Premium",
"family": "P",
"capacity": 1
},
"redisConfiguration": {
"aad-enabled": "True",
"maxmemory-reserved": "615"
},
"enableNonSslPort": false,
"publicNetworkAccess": "Disabled"
},
"zones": [
"1",
"2",
"3"
]
}
Configure with Bicep#
To set availability zones for Premium SKU Redis Cache:
- Set
zones
to a minimum of two zones from["1", "2", "3"]
. - Set
Properties.replicasPerMaster
to number of zones - 1, to ensure you have at least as many nodes as zones you are replicating to. - Set
Properties.sku.name
toPremium
. - Set
Properties.sku.family
toP
. - Set
Properties.sku.capacity
to one of[1, 2, 3, 4, 5]
, depending on the SKU you picked:P1
- 6 GBP2
- 13 GBP3
- 26 GBP4
- 53 GBP5
- 120 GB
For example:
resource cache 'Microsoft.Cache/redis@2024-03-01' = {
name: name
location: location
properties: {
redisVersion: '6'
sku: {
name: 'Premium'
family: 'P'
capacity: 1
}
redisConfiguration: {
'aad-enabled': 'True'
'maxmemory-reserved': '615'
}
enableNonSslPort: false
publicNetworkAccess: 'Disabled'
}
zones: [
'1'
'2'
'3'
]
}
Configure with Azure Verified Modules
A pre-validated module supported by Microsoft is available from the Azure Bicep public registry. To reference the module, please use the following syntax:
To use the latest version:
Notes#
This rule applies when analyzing resources deployed to Azure using pre-flight and in-flight data.
This rule fails when "zones"
is null
, []
or less than two zones are used when there are availability zones for the given region.
This rule fails when cache is not zone redundant(1, 2 and 3) when there are availability zones for the given region.
Configure AZURE_REDISCACHE_ADDITIONAL_REGION_AVAILABILITY_ZONE_LIST
to set additional availability zones that need to be supported which are not in the existing providers for namespace Microsoft.Cache
and resource type Redis
.
# YAML: The default AZURE_REDISCACHE_ADDITIONAL_REGION_AVAILABILITY_ZONE_LIST configuration option
configuration:
AZURE_REDISCACHE_ADDITIONAL_REGION_AVAILABILITY_ZONE_LIST: []
Links#
- RE:05 Regions and availability zones
- Enable zone redundancy for Azure Cache for Redis
- High availability for Azure Cache for Redis
- Azure deployment reference