Search code examples
azureredisazure-redis-cache

Azure Redis delete cache command not executing


I'm trying to delete the cache I created to reset the data, but when I run the following command

az redis delete --name listings --resource-group appsvc_linux_centralus

it says

Are you sure you want to perform this operation? (y/n): y

When I enter y, it returns nothing

enter image description here

I know it didn't work because when I refresh the page to hit this code

  client.get("listings", (err, reply) => {

console.log(reply);

  });
return;

It outputs all 30 listings from the cache. So the name is definitely correct and the resource group is grabbed from portal inside Redis service.

enter image description here

I don't understand why it doesn't delete. I appreciate any help!


Solution

  • I believe you're using the command incorrectly. Based on the documentation here, this command actually deletes the redis cache account and not the data itself.

    az redis delete

    Deletes a Redis cache.

    If you wish to clear the data, I believe you will need to use one of the Redis Cache SDKs and perform purge data operation using FLUSHALL command.