az redis
Manage dedicated Redis caches for your Azure applications.
Commands
Name | Description | Type | Status |
---|---|---|---|
az redis access-policy |
Manage Access Policies for Redis Cache. |
Core | GA |
az redis access-policy-assignment |
Manage Access Policy Assignments (Redis Users) for Redis Cache. |
Core | GA |
az redis access-policy-assignment create |
Add an Access Policy Assignment (Redis User) to the Redis Cache. |
Core | GA |
az redis access-policy-assignment delete |
Delete the Access Policy Assignment (Redis User). |
Core | GA |
az redis access-policy-assignment list |
Get the list of Access Policy Assignments (Redis Users) associated with the Redis Cache. |
Core | GA |
az redis access-policy-assignment show |
Get the detailed information about an Access Policy Assignment (Redis User) of the Redis Cache. |
Core | GA |
az redis access-policy-assignment update |
Update an Access Policy Assignment (Redis User) of the Redis Cache. |
Core | GA |
az redis access-policy create |
Add an Access Policy to the Redis Cache. |
Core | GA |
az redis access-policy delete |
Delete the Access Policy. |
Core | GA |
az redis access-policy list |
Get the list of Access Policies associated with the Redis Cache. |
Core | GA |
az redis access-policy show |
Get the detailed information about an Access Policy of the Redis Cache. |
Core | GA |
az redis access-policy update |
Update an Access Policy of the Redis Cache. |
Core | GA |
az redis create |
Create new Redis Cache instance. |
Core | GA |
az redis delete |
Deletes a Redis cache. |
Core | GA |
az redis export |
Export data stored in a Redis cache. |
Core | GA |
az redis firewall-rules |
Manage Redis firewall rules. |
Core | GA |
az redis firewall-rules create |
Create a redis cache firewall rule. |
Core | GA |
az redis firewall-rules delete |
Deletes a single firewall rule in a specified redis cache. |
Core | GA |
az redis firewall-rules list |
Gets all firewall rules in the specified redis cache. |
Core | GA |
az redis firewall-rules show |
Gets a single firewall rule in a specified redis cache. |
Core | GA |
az redis firewall-rules update |
Update a redis cache firewall rule. |
Core | GA |
az redis flush |
Delete all of the keys in a cache. |
Core | GA |
az redis force-reboot |
Reboot specified Redis node(s). |
Core | GA |
az redis identity |
Manage identity assigned to Azure cache for Redis. |
Core | GA |
az redis identity assign |
Assign identity for Azure cache for Redis. |
Core | GA |
az redis identity remove |
Remove the identity already assigned for Azure cache for Redis. |
Core | GA |
az redis identity show |
Show the identity assigned for Azure cache for Redis. |
Core | GA |
az redis import |
Import data into a Redis cache. |
Core | GA |
az redis import-method |
Import data into Redis cache. |
Core | Deprecated |
az redis list |
List Redis Caches. |
Core | GA |
az redis list-keys |
Retrieve a Redis cache's access keys. |
Core | GA |
az redis patch-schedule |
Manage Redis patch schedules. |
Core | GA |
az redis patch-schedule create |
Create patching schedule for Redis cache. |
Core | GA |
az redis patch-schedule delete |
Deletes the patching schedule of a redis cache. |
Core | GA |
az redis patch-schedule show |
Gets the patching schedule of a redis cache. |
Core | GA |
az redis patch-schedule update |
Update the patching schedule for Redis cache. |
Core | GA |
az redis regenerate-keys |
Regenerate Redis cache's access keys. |
Core | GA |
az redis server-link |
Manage Redis server links. |
Core | GA |
az redis server-link create |
Adds a server link to the Redis cache (requires Premium SKU). |
Core | GA |
az redis server-link delete |
Deletes the linked server from a redis cache (requires Premium SKU). |
Core | GA |
az redis server-link list |
Gets the list of linked servers associated with this redis cache (requires Premium SKU). |
Core | GA |
az redis server-link show |
Gets the detailed information about a linked server of a redis cache (requires Premium SKU). |
Core | GA |
az redis show |
Gets a Redis cache (resource description). |
Core | GA |
az redis update |
Update a Redis cache. |
Core | GA |
az redis create
Create new Redis Cache instance.
az redis create --location
--name
--resource-group
--sku {Basic, Premium, Standard}
--vm-size {c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5}
[--disable-access-keys {false, true}]
[--enable-non-ssl-port]
[--mi-system-assigned]
[--mi-user-assigned]
[--minimum-tls-version {1.0, 1.1, 1.2}]
[--redis-configuration]
[--redis-version]
[--replicas-per-master]
[--shard-count]
[--static-ip]
[--subnet-id]
[--tags]
[--tenant-settings]
[--update-channel {Preview, Stable}]
[--zones]
Examples
Create new Redis Cache instance. (autogenerated)
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Basic --vm-size c0
Configure the multiple zones for new Premium Azure Cache for Redis
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --zones 1 2
Configure the memory policies for the cache.
az redis create --resource-group resourceGroupName --name cacheName --location westus2 --sku Standard --vm-size c0 --redis-configuration @"config_max-memory.json"
Configure and enable the RDB back up data persistence for new Premium Azure Cache for Redis.
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --redis-configuration @"config_rdb.json"
Configure and enable the AOF back up data persistence for new Premium Azure Cache for Redis
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --redis-configuration @"config_aof.json"
Create a Premium Azure Cache for Redis with clustering enabled
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --shard-count 2
Deploying a Premium Azure Cache for Redis inside an existing Azure Virtual Network
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --subnet-id "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/Microsoft.{Network|ClassicNetwork}/virtualNetworks/vnet1/subnets/subnet1"
Deploying a Premium Azure Cache for Redis with Microsoft Entra Authentication configured and access keys disabled
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --disable-access-keys true --redis-configuration @"config_enable-aad.json"
Required Parameters
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Type of Redis cache.
Size of Redis cache to deploy. Basic and Standard Cache sizes start with C. Premium Cache sizes start with P.
Optional Parameters
Authentication to Redis through access keys is disabled when set as true.
If specified, then the non-ssl redis server port (6379) will be enabled.
Flag to specify system assigned identity.
One or more space separated resource IDs of user assigned identities.
Specifies the TLS version required by clients to connect to cache.
A json file used to set redis-configuration settings. You may encounter parse errors if the json file is invalid.
Usage: --redis-configuration @"{config_file.json}"
An example json file for configuring max-memory policies [ { "maxmemory-policy": "allkeys-lru" } ]
An example json file for enabling the RDB back up data persistence is [ { "rdb-storage-connection-string": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net", "rdb-backup-enabled": "true", "rdb-backup-frequency": "15", "rdb-backup-max-snapshot-count": "1" } ]
An example json file for enabling the AOF back up data persistence is [ { "aof-backup-enabled": "true", "aof-storage-connection-string-0": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net", "aof-storage-connection-string-1": "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net" } ]
The content for a json file for configuring Microsoft Entra Authentication is { "aad-enabled": "true", }.
Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.
The number of replicas to be created per master.
The number of shards to be created on a Premium Cluster Cache.
Specify a static ip if required for the VNET. If you do not specify a static IP then an IP address is chosen automatically.
The full resource ID of a subnet in a virtual network to deploy the redis cache in. Example format /subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/Microsoft.{Network|ClassicNetwork}/virtualNetworks/vnet1/subnets/subnet1.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Space-separated tenant settings in key[=value] format.
Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using "Preview" update channel get latest Redis updates at least 4 weeks ahead of "Stable" channel caches. Default value is "Stable".
Space-separated list of availability zones into which to provision the resource.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis delete
Deletes a Redis cache.
az redis delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis export
Export data stored in a Redis cache.
az redis export --container
--prefix
[--auth-method {ManagedIdentity, SAS}]
[--file-format]
[--ids]
[--name]
[--resource-group]
[--storage-sub-id]
[--subscription]
Examples
Use managed identity to export cache data
az redis export -n testCacheName -g testResourceGroup --prefix examplePrefix --container containerUrl --preferred-data-archive-auth-method ManagedIdentity --storage-subscription-id 1a6574ss-ddad-1111-a111-8d756312d1dd
Required Parameters
SAS url for container where data needs to be exported to.
Prefix to use for exported files.
Optional Parameters
Preferred auth method to communicate to storage account used for data archive, default value is SAS.
Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
SubscriptionId of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis flush
Delete all of the keys in a cache.
az redis flush [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis force-reboot
Reboot specified Redis node(s).
Usage example - az redis force-reboot --name testCacheName --resource-group testResourceGroup --reboot-type {AllNodes, PrimaryNode, SecondaryNode} [--shard-id].
az redis force-reboot --reboot-type {AllNodes, PrimaryNode, SecondaryNode}
[--ids]
[--name]
[--resource-group]
[--shard-id]
[--subscription]
Required Parameters
Which Redis node(s) to reboot. Depending on this value data loss is possible.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
If clustering is enabled, the ID of the shard to be rebooted.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis import
Import data into a Redis cache.
az redis import --files
[--auth-method {ManagedIdentity, SAS}]
[--file-format]
[--ids]
[--name]
[--resource-group]
[--storage-sub-id]
[--subscription]
Examples
Use managed identity to import cache data
az redis import -n testCacheName -g testResourceGroup --files blobUrl --preferred-data-archive-auth-method ManagedIdentity --storage-subscription-id 1a6574ss-ddad-1111-a111-8d756312d1dd
Required Parameters
SAS url for blobs that needs to be imported.
Optional Parameters
Preferred auth method to communicate to storage account used for data archive, default value is SAS.
Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
SubscriptionId of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis import-method
This command has been deprecated and will be removed in a future release. Use 'redis import' instead.
Import data into Redis cache.
Usage example - az redis import-method --name testCacheName --resource-group testResourceGroup --files [--file-format].
az redis import-method --files
[--auth-method {ManagedIdentity, SAS}]
[--file-format]
[--ids]
[--name]
[--resource-group]
[--storage-sub-id]
[--subscription]
Required Parameters
SAS url for blobs that needs to be imported.
Optional Parameters
Preferred auth method to communicate to storage account used for data archive, default value is SAS.
Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
SubscriptionId of the storage account.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis list
List Redis Caches.
Lists details about all caches within current Subscription or provided Resource Group.
az redis list [--resource-group]
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis list-keys
Retrieve a Redis cache's access keys.
This operation requires write permission to the cache resource.
az redis list-keys [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis regenerate-keys
Regenerate Redis cache's access keys.
Usage example - az redis regenerate-keys --name testCacheName --resource-group testResourceGroup --key-type {Primary, Secondary}.
az redis regenerate-keys --key-type {Primary, Secondary}
[--ids]
[--name]
[--resource-group]
[--subscription]
Required Parameters
The Redis access key to regenerate.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis show
Gets a Redis cache (resource description).
az redis show [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az redis update
Update a Redis cache.
Scale or update settings of a Redis cache.
az redis update [--add]
[--force-string]
[--ids]
[--name]
[--no-wait {false, true}]
[--remove]
[--resource-group]
[--set]
[--sku {Basic, Premium, Standard}]
[--subscription]
[--vm-size {c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5}]
Examples
Update the maxmemory-policy for your Azure Cache for Redis named MyRedisCache
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.maxmemory-policy"="allkeys-lru"
Disable the RDB back up data persistence for Premium Azure Cache for Redis
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.rdb-backup-enabled"="false"
Configure the RDB back up enabled data persistence for already created Premium Azure Cache for Redis
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.rdb-storage-connection-string"="BlobEndpoint=https//..." "redisConfiguration.rdb-backup-enabled"="true" "redisConfiguration.rdb-backup-frequency"="15" "redisConfiguration.rdb-backup-max-snapshot-count"="1"
Scale an Azure Cache for Redis Instance - Update to different size (An example to scale from c0 to c1).
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "sku.capacity"="2"
Scale an Azure Cache for Redis Instance - Update to different tier (From Basic to Standard or Standard to Premium).
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "sku.name"="Premium" "sku.capacity"="1" "sku.family"="P"
Scale an Azure Cache for Redis Instance - Enable Clustering.
az redis update --name MyRedisCache --resource-group MyResourceGroup --set shardCount=1
Scale an Azure Cache for Redis Instance in/out using Redis Cluster.
az redis update --name MyRedisCache --resource-group MyResourceGroup --set shardCount=2
Disable access keys authentication for Redis.
az redis update --name MyRedisCache --resource-group MyResourceGroup --set "disableAccessKeyAuthentication=true"
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the Redis cache.
Argument 'no_wait' has been deprecated and will be removed in a future release.
Specify as false to wait for result of long running operation.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Type of Redis cache.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Size of Redis cache to deploy. Basic and Standard Cache sizes start with C. Premium Cache sizes start with P.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI