microsoft / AzureStorageExplorer

Easily manage the contents of your storage account with Azure Storage Explorer. Upload, download, and manage blobs, files, queues, tables, and Cosmos DB entities. Gain easy access to manage your virtual machine disks. Work with either Azure Resource Manager or classic storage accounts, plus manage and configure cross-origin resource sharing (CORS) rules.
Creative Commons Attribution 4.0 International
371 stars 85 forks source link

Feature Request: add a "Clear all queues" context menu option for Azurite (or emulator) queues #6683

Open codywilliamson opened 1 year ago

codywilliamson commented 1 year ago

Preflight Checklist

Problem

When using Azurite or any other emulated service for local development, there might be a lot of test data created. I find myself manually deleting a lot of queue items across several queues.

Desired Solution

It would be helpful to be able to right-click an emulator's entire queue and clear all messages

Alternatives and Workarounds

Manually clear all messages from each queue (possibly deleting generated data files, but haven't tested this)

Additional Context

No response

MRayermannMSFT commented 1 year ago

Hi @codywilliamson for this scenario we would recommend you go with deleting the Azurite data files to accomplish what you are looking for.

The files/folders Azurite uses to track queue data appear to be:

  1. Start Azurite
  2. Create queues such that you are in the desired "having a bunch of queues but none with messages" state
  3. Copy and paste the queue data files/folders somewhere else in order to backup that state
  4. Do your work until you get to the point of wanting to restore back to the "having a bunch of queues but none with messages" state
  5. Stop Azurite
  6. Delete the queue data files/folders in your Azurite folder
  7. Copy and paste the backup files/folder you created in step 3 back into your Azurite folder

Does that make sense?

codywilliamson commented 1 year ago

That's a great workaround and I can build some scripts that do this for me. I was more so hoping for a built-in way to do this, but thank you for the direction!

MRayermannMSFT commented 1 year ago

I was more so hoping for a built-in way

Understood. For now this sounds like a pretty niche feature, and one which has the potential to accidentally cause someone a lot of headache if they don't know what they are doing. So for now the self-scripted solution is what we'll recommend. We'll leave this open in our future milestone in case others come along wanting it as well.