Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Delete an Azure Redis Cache Instance via CMD in Windows

Azure Redis Cache is a powerful in-memory data store that provides high throughput and low latency data access. Sometimes, you may need to delete an Azure Redis Cache instance, whether for cleanup, cost management, or reconfiguration purposes. This article will guide you through the steps to delete an Azure Redis Cache instance using the Azure Command-Line Interface (CLI) on a Windows environment.

Prerequisites

Before you start, ensure you have the following:

  1. Azure CLI installed on your Windows machine. You can download and install it from here.
  2. Azure Subscription with the necessary permissions to delete resources.

Step-by-Step Guide

Step 1: Open Command Prompt

Press Win + R, type cmd, and press Enter to open the Command Prompt.

Step 2: Log in to Azure

First, you need to log in to your Azure account. Run the following command:

az login

A new browser window will open prompting you to enter your Azure credentials. After successful login, you will see a list of your subscriptions in the Command Prompt.

Step 3: Set the Subscription Context

If you have multiple subscriptions, set the context to the subscription where your Redis Cache instance resides:

az account set --subscription "Your-Subscription-ID"

Step 4: List Redis Cache Instances

To ensure you have the correct name of the Redis Cache instance you want to delete, list all the Redis Cache instances in your subscription:

az redis list --output table

This command will display all Redis Cache instances with their respective names and resource groups.

Step 5: Delete the Redis Cache Instance

Now, delete the specific Redis Cache instance using the following command:

az redis delete --name "Your-Redis-Cache-Name" --resource-group "Your-Resource-Group-Name"

Replace "Your-Redis-Cache-Name" and "Your-Resource-Group-Name" with the actual name of your Redis Cache instance and its resource group.

Step 6: Confirm Deletion

You can confirm the deletion by listing the Redis Cache instances again:

az redis list --output table

The deleted instance should no longer appear in the list.

Examples

Example 1: Deleting a Redis Cache Instance

az login
az account set --subscription "12345678-1234-1234-1234-123456789abc"
az redis list --output table
az redis delete --name "myRedisCache" --resource-group "myResourceGroup"
az redis list --output table

Example 2: Deleting a Redis Cache Instance with JSON Output

az login
az account set --subscription "12345678-1234-1234-1234-123456789abc"
az redis list --output json
az redis delete --name "myRedisCache" --resource-group "myResourceGroup"
az redis list --output json

Conclusion

Deleting an Azure Redis Cache instance via the Command-Line Interface on Windows is straightforward. By following the steps outlined above, you can efficiently manage your Azure resources directly from the Command Prompt.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.