Creating and Managing Azure Redis Cache in Azure Government Cloud

This topic shows how to connect to the Microsoft Azure Gov cloud using Powershell 1.0 and create Redis cache service.

Azure Redis Cache is based on the popular open-source Redis cache. It gives you access to a secure, dedicated Redis cache, managed by Microsoft and accessible from any application within Azure.

Read more about Azure Redis Cache and the new premium features.

First, you must logon to Azure Gov Cloud with this command.

LoginAzureRmAccount -EnvironmentName “AzureUSGovernment”

Specify the email address of your Azure Gov account and its password in the Microsoft Azure sign-in dialog.

Next, if you have multiple Azure subscriptions, you need to set your Azure subscription. To see a list of your current subscriptions, run this command.

Get-AzureRmSubscription | Select SubscriptionName

To specify the subscription, run the following command.

Select-AzureRmSubscription -SubscriptionName <yoursubscription>

To get detailed help for any cmdlet you see in this tutorial, use the Get-Help cmdlet.

GetHelp <cmdlet-name> –Detailed

For example, to get help for the New-AzureRmRedisCache cmdlet, type:

Get-Help New-AzureRmRedisCache -Detailed

To create a new Resource Group in the US government Virginia location, type:

New-AzureRmResourceGroup -Name myGroup -Location “usgovvirginia”

To create a cache with default parameters, run the following command.

New-AzureRmRedisCache -ResourceGroupName myGroup -Name mycache -Location “usgovvirginia”

ResourceGroupNameName, and Location are required parameters, but the rest are optional and have default values. Running the previous command creates a Standard SKU Azure Redis Cache instance with the specified name, location, and resource group, that is 1 GB in size with the non-SSL port disabled.

Once the redis cache is created, run the following command to check the status:



Name : mycache

Id : /subscriptions/…../resourceGroups/testchan123/providers/Microsoft.Cache/Redis/mycache

Location : USGov Virginia

Type : Microsoft.Cache/Redis

HostName :

Port : 6379

ProvisioningState : Succeeded

SslPort : 6380

RedisConfiguration : {[maxclients, 1000], [maxmemory-reserved, 50], [maxmemory-delta, 50]}

EnableNonSslPort : False

RedisVersion : 3.0

Size : 1GB

Sku : Standard

ResourceGroupName : myGroup

VirtualNetwork :

Subnet :

StaticIP :

TenantSettings : {}

ShardCount :


This should get you started on using the Redis cache by referring to the Hostname. For more details on Redis cache on Azure refer to:


Leave a Reply

Your email address will not be published. Required fields are marked *