“az redis” Command Examples

The az redis command is part of the azure-cli tool, which is the official Command-Line Interface (CLI) provided by Microsoft for managing Azure resources and services.

The az redis command allows you to manage Redis caches in Azure. Redis is an open-source, in-memory data structure store that can be used as a cache, message broker, or database. Here’s an overview of its functionality:

  • Cache Creation: With the az redis create subcommand, you can create a new Redis cache in Azure. You can specify the cache name, resource group, location, size, and other configurations such as the Redis version and networking settings.
  • Cache Management: The az redis update subcommand allows you to modify the properties and settings of an existing Redis cache. You can update configurations such as the cache size, Redis version, networking settings, access keys, and more.
  • Cache Deletion: Using the az redis delete subcommand, you can delete a Redis cache that is no longer needed. This permanently removes the cache and its associated data. Exercise caution when using this command as it is irreversible.
  • Cache Scaling: The az redis update subcommand with appropriate parameters allows you to scale the size of an existing Redis cache up or down. This enables you to adjust the cache capacity based on your application’s needs and performance requirements.
  • Cache Access Keys: With the az redis list-keys subcommand, you can retrieve the access keys associated with a Redis cache. These keys are used to authenticate and connect to the cache from your applications or tools.
  • Cache Listing: The az redis list subcommand provides a list of all Redis caches in your Azure subscription or a specific resource group. This allows you to view the cache names, locations, resource groups, and other details for better management and organization.

Azure Redis Cache is a fully managed, high-performance caching service provided by Microsoft Azure. It enables you to store and retrieve data in-memory, which can significantly improve the performance and responsiveness of your applications.

az redis Command Examples

1. 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]

2. 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]

3. Export data stored in a Redis cache:

# az redis export --container container --file-format file-format --name name --prefix prefix --resource-group resource_group

4. Delete a Redis cache:

# az redis delete --name name --resource-group resource_group --yes
Related Post