How to Set and Get Custom Properties of a Service Bus Message in Logic App

Published Aug 13 2021 01:39 PM 1,583 Views
Microsoft

In send message action, we can add a JSON object with key value pairs as "Properties", and we can also set "System properties" to "Run Details".

 

xgan_0-1628883040002.png

 

Once the logic app run finishes, we can use the Service Bus Explorer tool on the service bus portal to download the message and see its properties:

 

xgan_0-1628882821871.png

x-ms-client-tracking-id is the "System properties" we set in the logic app send message action, and it is actually the run id of the logic app which has created this message. 

 

If we do not use the Service Bus Explorer to download the message, instead we use a service bus trigger to retrieve the message back to logic app, we will get these same properties back.

 

xgan_1-1628884354118.png

 

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2646959%22%20slang%3D%22en-US%22%3EHow%20to%20Set%20and%20Get%20Custom%20Properties%20of%20a%20Service%20Bus%20Message%20in%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2646959%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20send%20message%20action%2C%20we%20can%20add%20a%20JSON%20object%20with%20key%20value%20pairs%20as%20%22Properties%22%2C%20and%20we%20can%20also%20set%20%22System%20properties%22%20to%20%22Run%20Details%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xgan_0-1628883040002.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303187i3A2F6CE89B8120AF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xgan_0-1628883040002.png%22%20alt%3D%22xgan_0-1628883040002.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20logic%20app%20run%20finishes%2C%20we%20can%20use%20the%20Service%20Bus%20Explorer%20tool%20on%20the%20service%20bus%20portal%20to%20download%20the%20message%20and%20see%20its%20properties%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xgan_0-1628882821871.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303185i0D9149F77307F250%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xgan_0-1628882821871.png%22%20alt%3D%22xgan_0-1628882821871.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ex-ms-client-tracking-id%3C%2FSTRONG%3E%20is%20the%20%22System%20properties%22%20we%20set%20in%20the%20logic%20app%20send%20message%20action%2C%20and%20it%20is%20actually%20the%20run%20id%20of%20the%20logic%20app%20which%20has%20created%20this%20message.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20we%20do%20not%20use%20the%20Service%20Bus%20Explorer%20to%20download%20the%20message%2C%20instead%20we%20use%20a%20service%20bus%20trigger%20to%20retrieve%20the%20message%20back%20to%20logic%20app%2C%20we%20will%20get%20these%20same%20properties%20back.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xgan_1-1628884354118.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303197i64303CBDFE5DA5D6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xgan_1-1628884354118.png%22%20alt%3D%22xgan_1-1628884354118.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2646959%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20using%20logic%20app%20to%20integrate%20service%20bus%20with%20other%20system%2C%20there%20is%20a%20way%20to%20set%2Fget%20custom%20properties%20of%20service%20bus%20messages.%20These%20custom%20properties%20may%20help%20with%20correlation%20and%20tracking%20needs%20in%20integration.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2646959%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELogic%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Aug 13 2021 01:39 PM
Updated by: