I have a logic app that receives data from another logic app in a separate subscription/tenant. The data payload originates from IoT Hub.
I want to maintain the property iothub-enqueuedtime from the original IoT hub ingestion. I can send it over by adding iothub-enqueuedtime to the headers of the HTTP transaction between the two logic apps, but I am struggling with how to add it to a service bus queue as a custom property. I'm trying to retain this for onward processing.
I guess I'm missing some specific syntax for the properties expression when sending it to a message queue, but I'm coming up blank when searching for a answer.
Send message config
Result of the run when sending message to service bus
What was received in the step following the service bus, missing iothub-enqueuedtime or anything like it.
Yes, you can add custom property as below:
Code view:
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Send_message": {
"inputs": {
"body": {
"ContentData": "@{base64('HeyMan')}",
"Properties": {
"iothub-enqueuedtime": "11:10"
}
},
"host": {
"connection": {
"name": "@parameters('$connections')['servicebus']['connectionId']"
}
},
"method": "post",
"path": "/@{encodeURIComponent(encodeURIComponent('rithwik'))}/messages",
"queries": {
"systemProperties": "None"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"servicebus": {
"connectionId": "/subscriptions/b83c1ed3-cf/resourceGroups/bojja/providers/Microsoft.Web/connections/servicebus",
"connectionName": "servicebus",
"id": "/subscriptions/b83c1ed3-c5b6c23f/providers/Microsoft.Web/locations/eastus/managedApis/servicebus"
}
}
}
}
}
Output:
Inside Service bus queue(In portal):
You will see the property in the custom property of message in service bus queue rather than inside the body or in the logic app(but this will be added to message in queue , but will not be shown in logic app as this is its functionality), if you want to send inside body, you have to insert it inside the content as @skin commented.