azure - 从逻辑应用中的服务总线获取内容

标签 azure azureservicebus azure-logic-apps

我是 Azure 逻辑应用的新手。我有一个服务总线,并将 json 对象消息传递给该服务总线,然后我在逻辑应用程序中设置一个操作来监听我的服务总线。因此,每次有新消息进入该服务总线时,我的逻辑应用程序都会拾取它 enter image description here并将其发送到http。

我的问题是如何从服务总线中的消息中获取属性并将其传递给我的 http 操作。我试过这个

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

但它不起作用

最佳答案

谁以及如何发送队列上的消息?

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

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

这是我的逻辑应用程序的样子 enter image description here

在我的例子中,消息是从 Azure Webjob 作为 BrokeredMessage 发送的:

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

client.Send(msg);

关于azure - 从逻辑应用中的服务总线获取内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43796841/

相关文章:

c# - 如何在本地测试 Azure ActiveDirectory?

Azure IOT Apache Avro 格式

c# - 当 RegisterEventBus "No service for type Autofac.ILifetimeScope' 已注册时。

amazon-web-services - AWS 相当于 Azure 逻辑应用

loops - Azure 逻辑应用 - 执行直到计数和超时属性

azure - 是否可以在 Azure WebRole (MVC) 中托管 WCF 服务

azure - 对于 Azure 可用性集,拥有 1 个故障域和 1 个更新域的可用性集有何意义

c# - Azure 服务总线队列订阅对 IIS 应用程序空闲状态有何影响?

.net - Azure.Messaging.ServiceBus 无法配置 TransportType

azure - 逻辑应用消费 API 连接 - ARM 模板函数