简体   繁体   中英

Azure Storage Queue message to Azure Blob Storage

I have access to a Azure Storage Queue using a connection string which was provided to me (not my created queue). The messages are sent once every minute. I want to take all the messages and place them in Azure Blob Storage.

My issue is that I haven't been succesful in getting the message from the attached Storage Queue. What is the "easiest" way of doing this data storage?

I've tried accessing the external queue using Logic Apps and then tried to place it in my own queue before moving it to Blob Storage, however without luck.

If you want to access and external storage in the logic app, you will need the name of the storage account and the Key.

You have to choose the trigger for an azure queues and then click in the "Manually enter connection information".

And in the next step you will be able to choose the queue you want to listen for. 在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

I recomend you to use and azure function, something like in this article:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-output?tabs=csharp

Firts you can try only reading the messages, and then add the output that create your blob:

     [FunctionName("GetMessagesFromQueue")]
     public IActionResult GetMessagesFromQueue(
    [QueueTrigger("%ExternalStorage.QueueName%", Connection = "ExternalStorage.StorageConnection")ModelMessage modelmessage,
    [Blob("%YourStorage.ContainerName%/{id}", FileAccess.Write, Connection = "YourStorage.StorageConnection")] Stream myBlob)
    {
        //put the modelmessage into the stream
    }

You can bind to a lot of types not only Stream. In the link you have all the information.

I hope I've helped

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM