Skip to content

Instantly share code, notes, and snippets.

@JonCole
Last active February 24, 2021 02:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JonCole/92c669ea482bbb7996f6428fb6c3eb97 to your computer and use it in GitHub Desktop.
Save JonCole/92c669ea482bbb7996f6428fb6c3eb97 to your computer and use it in GitHub Desktop.

Azure Redis Availability Zones

Azure Redis now enables you to protect yourself from data center level failures through support for Availability Zones. By pinning your cache to a specific zone, you can ensure that your cache and application are contained within the same zone. You can then deploy your application to multiple zones, thus limiting the impact to your application should a data center specific failure occur. This feature is supported on the Premium Tier.

Instructions for getting started

  1. Please visit https://docs.microsoft.com/en-us/azure/availability-zones/az-overview for general intro to Availability Zones.
  2. Zonal Redis Cache offering is available on the Premium Tier and allows you to pin a redis cache to a specific zone when in a region that supports Azure availability zones (see list below).
  3. To troubleshoot any issues encountered while creating a zonal redis cache please visit https://aka.ms/redis/errors/AvailabilityZoneMissing

Supported Regions

The following regions are currently supported for Availability Zones:

  • Central US
  • East US
  • East US 2
  • West US 2
  • France Central
  • North Europe
  • UK South
  • West Europe
  • Japan East
  • Southeast Asia

Replicating data cross zones

Some customers may want to use a single cache instance within a region but still have the ability to fail over to a different cache instance in the event of a cache or data center failure. This can be done by combining zonal pinning as described in this article with our existing Geo-Replication feature. In spite of the name, geo-replication can be configured on two caches within the same region, which allows you to replicate data from one cache instance to another cache instance.

Instructions

  1. Create a premium tier cache in one zone
  2. Create a second premium tier cache of the same size in another zone in the same region
  3. Follow the Geo-Replication instructions which will link the two caches in steps 1 and 2. Once linked, the primary cache instance will be read/write and the secondary instance will be readonly until the link between the cache instances is removed.
  4. If you need to fail over to the secondary cache instance (e.g. due to a failure in the primary cache's zone), follow the previously linked Geo-Replciation instructions for removing the link and then configure your application to use the secondary cache instead of the primary cache.

Important Note about Preview Regions

If you are looking to use Availability Zones in any of the "Preview" regions listed here, you will need to register your subscription for access to that preview region using the following instructions:

From Powershell, they can run the following:

  1. Login-AzureRmAccount
  2. Set-AzureRmContext -SubscriptionId "*Your_User_Subscription_ID_To_Be_Whitelisted*"
  3. To get a list of available AFEC flags: Get-AzureRmProviderFeature -ListAvailable
  4. To register for the AvailabilityZones AFEC flag: Register-AzureRmProviderFeature -FeatureName "AvailabilityZones" -ProviderNamespace "Microsoft.Resources"

Zone information may be missing on your subscription due to multiple reasons:

  1. Subscription might not have been registered with the 'Microsoft.Cache' provider: Please run the following powershell command (after logging in into your subscription):

    Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Cache

  2. Your subscription might not have been enabled for zones: Please raise a support ticket with Azure support, so that they can enable your subscription for zones. Once this step is completed, please execute step 1 (even if you have already registered your subscription with the Microsoft.Cache provider).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment