Search code examples
azure-logic-appsazure-storage-queues

Put/Post JSON message to Azure Storage Queue via Logic App


I want to be able to use Logic Apps to put/post messages in an Azure Storage Queue, because I want to make use of the Managed Identity option that HTTP Logic App acion provides.

I have a Logic App that uses HTTP action to post XML messages to the queue and I have a "Put a message on a queue" action that puts JSON message to the queue for debugging purposes.

My ultimate goal is to be able to use the HTTP action with Managed Identity as Authentication but be able to post JSON messages to the queue like the "Put a message on a queue" action is able to.

enter image description here

enter image description here


Solution

  • Here is what worked for me:

    1. Enabled "Managed Identity" on the Logic App.

    2. Added Storage-Queue-Contributor permissions on the storage queue.

    3. Used utcnow('R') to get this date format ("Tue, 08 Sep 2020 12:03:08 GMT") for x-ms-date HTTP header (no doc from MS about this).

    4. Inserted JSON data inside

      <QueueMessage> 
          <MessageText>
          {
            "car": "Audi",
            "year": 1983
          }
         </MessageText>  
      </QueueMessage>
      

    Final result in Logic App designer: enter image description here