Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting content from service bus in logic apps

I am new to Azure logic apps. I have a service bus and pass a json object message to that service bus then I set up an action in logic apps to listen to my service bus. So everytime a new message come in to that service bus my logic apps will pick it upenter image description here and send it to http.

My question is how can I grab the property from the message in service bus and pass it to my http action. I tried this

“Id” : “@{json(triggerBody()[‘ContentData’]).id}”

but it's not working

like image 633
Ramppy Dumppy Avatar asked Dec 13 '22 23:12

Ramppy Dumppy


2 Answers

Who and how is sending the message on the queue?

I read a json message property (DestinationPath) in this way:

@{json(base64ToString(triggerBody()?['ContentData'])).DestinationPath}

Here is how my Logic App looks like enter image description here

and in my case the message is sent from an Azure webjob as a BrokeredMessage:

string jsonMessage = JsonConvert.SerializeObject(myObject);
Stream streamMessage = new MemoryStream(Encoding.UTF8.GetBytes(jsonMessage));
BrokeredMessage msg = new BrokeredMessage(streamMessage);

client.Send(msg);
like image 158
Davis Molinari Avatar answered Jan 21 '23 18:01

Davis Molinari


My precise setup to decrypt the base 64 message using the interface. Easy enough to type into the expression builder.

json(base64ToString(triggerBody()?['ContentData']))

decrypt base 64 service bus message

like image 31
markokstate Avatar answered Jan 21 '23 19:01

markokstate