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
377 stars 87 forks source link

New Feature for Azure Queue - Export button #7980

Open viennamari opened 5 months ago

viennamari commented 5 months ago

Preflight Checklist

Problem

I cannot export all of my queue messages

Desired Solution

Add a functionality to export all of my queue messages to a csv file and an option to choose a delimiter

Alternatives and Workarounds

No response

Additional Context

So that the same csv file can be used for the import function in Azure Queue.

craxal commented 2 months ago

@viennamari When you say "all" of your messages, do you mean up to the maximum of 32 messages that can be peeked at?

Here's the problem with exporting all messages in your queue. The maximum number of messages that can be looked at nondestructively is 32 (that's why you can only see the first 32 messages in Storage Explorer). The only way to get at more messages is to dequeue and delete messages. Assuming you don't want to remove the messages during export, the only possible way I can think of to export all messages is to repeat these steps for every message:

  1. Get the message.
  2. Write the message to the export file.
  3. Delete the message.
  4. Requeue the message.

To prevent an endless export cycle, we would get the approximate number of messages in the queue at the start of the operation as a count for the number of messages to export.

This all comes with some risks:

Generally speaking, we stray away from implementing Storage Explorer features that can be unexpectedly destructive. At the very least, we warn users if something is risky and can't be undone. Conversely, limiting export to the top 32 messages is much safer and easier to work with.

Please let us know your thoughts.

craxal commented 1 month ago

@viennamari Have you had a chance to review my previous comment?

I think what we will do is we will proceed with the top 32 import regardless. If you need more than that, we need your thoughts for further consideration, otherwise we probably won't risk it for the reasons sited above.

viennamari commented 1 month ago

I am contented with the reason or answer as to why it was set to 32 messages max. Thanks!