从逻辑应用中的服务总线获取内容
Getting content from service bus in logic apps
我是 Azure 逻辑应用的新手。我有一个服务总线并将 json 对象消息传递给该服务总线,然后我在逻辑应用程序中设置一个操作来侦听我的服务总线。因此,每当有新消息进入该服务总线时,我的逻辑应用程序都会将其接收 并将其发送到 http。
我的问题是如何从服务总线中的消息中获取 属性 并将其传递给我的 http 操作。我试过这个
“Id” : “@{json(triggerBody()[‘ContentData’]).id}”
但它不起作用
谁以及如何发送队列中的消息?
我以这种方式阅读 json 消息 属性 (DestinationPath):
@{json(base64ToString(triggerBody()?['ContentData'])).DestinationPath}
这是我的逻辑应用程序的样子
在我的例子中,消息作为 BrokeredMessage 从 Azure webjob 发送:
string jsonMessage = JsonConvert.SerializeObject(myObject);
Stream streamMessage = new MemoryStream(Encoding.UTF8.GetBytes(jsonMessage));
BrokeredMessage msg = new BrokeredMessage(streamMessage);
client.Send(msg);
Service Bus 消息的 ContentData 是 Base64 编码的,因此您需要先对其进行解码,例如
“Id” : “@{json(base64ToString(triggerBody()?[‘ContentData’])).id}”
Logic 应用现在具有用于解码 Base 64 编码值的表达式。
我的要求是将编码的 ServiceBus 消息解码为 Azure 函数。我使用 Logic App Expression decodeBase64() 解决了这个问题,它可以接受字符串类型的动态内容,在本例中是消息的 'Content'- 内容,以及解码后的 json 字符串 returns .
decodeBase64(triggerBody()?['ContentData'])
附上屏幕截图以供参考。
In the place holder for input to the action, include an expression and choose decodeBase64()
Get back to Dynamic Content tab to select 'Content' available from previous step, on hitting OK the expression would get generated
我使用接口解密 base 64 消息的精确设置。很容易输入表达式生成器。
json(base64ToString(triggerBody()?['ContentData']))
我是 Azure 逻辑应用的新手。我有一个服务总线并将 json 对象消息传递给该服务总线,然后我在逻辑应用程序中设置一个操作来侦听我的服务总线。因此,每当有新消息进入该服务总线时,我的逻辑应用程序都会将其接收
我的问题是如何从服务总线中的消息中获取 属性 并将其传递给我的 http 操作。我试过这个
“Id” : “@{json(triggerBody()[‘ContentData’]).id}”
但它不起作用
谁以及如何发送队列中的消息?
我以这种方式阅读 json 消息 属性 (DestinationPath):
@{json(base64ToString(triggerBody()?['ContentData'])).DestinationPath}
这是我的逻辑应用程序的样子
在我的例子中,消息作为 BrokeredMessage 从 Azure webjob 发送:
string jsonMessage = JsonConvert.SerializeObject(myObject);
Stream streamMessage = new MemoryStream(Encoding.UTF8.GetBytes(jsonMessage));
BrokeredMessage msg = new BrokeredMessage(streamMessage);
client.Send(msg);
Service Bus 消息的 ContentData 是 Base64 编码的,因此您需要先对其进行解码,例如
“Id” : “@{json(base64ToString(triggerBody()?[‘ContentData’])).id}”
Logic 应用现在具有用于解码 Base 64 编码值的表达式。
我的要求是将编码的 ServiceBus 消息解码为 Azure 函数。我使用 Logic App Expression decodeBase64() 解决了这个问题,它可以接受字符串类型的动态内容,在本例中是消息的 'Content'- 内容,以及解码后的 json 字符串 returns . decodeBase64(triggerBody()?['ContentData'])
附上屏幕截图以供参考。
In the place holder for input to the action, include an expression and choose decodeBase64()
Get back to Dynamic Content tab to select 'Content' available from previous step, on hitting OK the expression would get generated
我使用接口解密 base 64 消息的精确设置。很容易输入表达式生成器。
json(base64ToString(triggerBody()?['ContentData']))