LinuxCommandLibrary

az-redis

Manage Azure Cache for Redis instances

TLDR

Create a new Redis cache instance

$ az redis create --location [location] --name [name] --resource-group [resource_group] --sku [Basic|Premium|Standard] --vm-size [c0|c1|c2|c3|c4|c5|c6|p1|p2|p3|p4|p5]
copy

Update a Redis cache
$ az redis update --name [name] --resource-group [resource_group] --sku [Basic|Premium|Standard] --vm-size [c0|c1|c2|c3|c4|c5|c6|p1|p2|p3|p4|p5]
copy

Export data stored in a Redis cache
$ az redis export --container [container] --file-format [file-format] --name [name] --prefix [prefix] --resource-group [resource_group]
copy

Delete a Redis cache
$ az redis delete --name [name] --resource-group [resource_group] --yes
copy

SYNOPSIS

az redis [command] [options]

PARAMETERS

create --name --resource-group --location --sku --vm-size [--enable-non-ssl-port {false,true}] [--minimum-tls-version {1.0,1.1,1.2}] [--redis-configuration ] [--shard-count ] [--static-ip ] [--subnet-id ] [--tags ] [--tenant-settings ] [--zones ]
    Creates a new Redis cache.

delete --name --resource-group [--yes]
    Deletes a Redis cache.

export --name --resource-group --prefix --container
    Exports data from the Redis cache to a storage container.

force-reboot --name --resource-group --reboot-type {AllNodes,PrimaryNode,SecondaryNode} [--shard-id ]
    Reboots specified Redis node(s).

import-data --name --resource-group --files
    Imports data from a storage container to the Redis cache.

list [--resource-group ]
    Lists all Redis caches within a subscription, or within a resource group.

list-keys --name --resource-group
    Lists the access keys for a Redis cache.

regenerate-keys --name --resource-group --key-type {primary,secondary}
    Regenerates access keys for a Redis cache.

show --name --resource-group
    Shows information about a Redis cache.

update --name --resource-group [--enable-non-ssl-port {false,true}] [--minimum-tls-version {1.0,1.1,1.2}] [--redis-configuration ] [--sku ] [--tags ] [--tenant-settings ] [--vm-size ]
    Updates settings for a Redis cache.

DESCRIPTION

The `az redis` command provides a comprehensive interface for managing Azure Cache for Redis instances through the Azure Command-Line Interface (Azure CLI). It allows users to create, update, delete, and monitor Redis caches within their Azure subscriptions.

Using `az redis`, you can configure various aspects of your Redis cache, including the cache size, pricing tier, network settings, firewall rules, and security features like authentication and TLS encryption. You can also manage linked servers for geo-replication, import/export data, and perform other administrative tasks. The command supports both standard and premium tiers, offering options for performance and scalability to meet different application requirements.

This command is particularly useful for automating Redis cache management tasks, integrating with CI/CD pipelines, and managing Redis infrastructure as code. Through its subcommands, `az redis` offers fine-grained control over your Azure Redis deployment, empowering developers and administrators to efficiently operate and scale their Redis-based applications.

AUTHENTICATION

To interact with Azure resources, you typically need to authenticate. The `az login` command is used for this purpose. Ensure you have the necessary permissions within your Azure subscription to manage Redis caches.

SKU AND SIZE

The `sku` and `vm-size` parameters during Redis cache creation define the pricing tier and the memory allocation, respectively. Select them based on expected workload and performance requirements. Available SKUs includes Basic, Standard, Premium, Enterprise, and EnterpriseFlash.

For example:`az redis create --name MyRedis --resource-group MyRG --location eastus --sku Basic --vm-size C0`

CONFIGURATION

The `--redis-configuration` parameters is complex and contain json with redis parameters. It is possible to set parameter value using key=value format (example: `maxmemory-policy=volatile-lru`). It is also possible to remove value of parameter using key=. (example: `maxmemory-policy=`).

SEE ALSO

az group(1), az storage(1)

Copied to clipboard