在逻辑应用程序中从服务总线获取内容 [英] Getting content from service bus in logic apps

查看:73
本文介绍了在逻辑应用程序中从服务总线获取内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Azure逻辑应用程序的新手.我有一条服务总线,并将json对象消息传递到该服务总线,然后在逻辑应用程序中设置了一个操作来侦听我的服务总线.因此,每当一条新消息传入该服务总线时,我的逻辑应用程序就会将其提取,并将其发送到http.

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 up and send it to http.

我的问题是如何从服务总线中的消息中获取属性并将其传递给我的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}"

但它不起作用

推荐答案

谁以及如何在队列中发送消息?

Who and how is sending the message on the queue?

我以这种方式读取json消息属性(DestinationPath):

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

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

这是我的逻辑应用程序的外观

Here is how my Logic App looks like

并且在我的情况下,消息是从Azure Web作业作为BrokeredMessage发送的:

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);

这篇关于在逻辑应用程序中从服务总线获取内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆