想要创建Azure Logic App表达式

问题描述 投票:1回答:1

在Azure Logic App中,我正在创建blob事件网格。每当我从存储帐户添加或删除blob时,我都能够获得事件。在那我得到以下的回应。

enter image description here

在主题中,我收到的响应为'/blobServices/default/containers/james/blobs/catputvendor/Capture.PNG'

现在我需要编写一个低于结果的表达式。 '/james/catputvendor/Capture.PNG'。哪种表达最好。

我使用c#工作得到了以下表达式,但在逻辑app表达式中,我们没有Remove方法。我需要在逻辑应用程序中做如下操作:

var subStri1 = str.Remove(str.IndexOf("/blobs"), "/blobs".Length).Substring(str.Remove(str.IndexOf("/blobs"), "/blobs".Length).LastIndexOf("/containers") + "/containers".Length);
azure azure-logic-apps
1个回答
2
投票

SubjectDynamic content,它是关于blob的绝对路径。所以你可以使用split表达式来获得你想要的路径。

而表达式将是这样的:split(triggerBody()?['subject'], '/')?[4]。我的主题路径是/blobServices/default/containers/firstcontainer/blobs/test/Snipaste_2018-11-13_10-08-08.png。因此表达式将获得容器名称firstcontainer

所以整个表达将是@{split(triggerBody()?['subject'], '/')?[4]}/@{split(triggerBody()?['subject'], '/')?[6]}/@{split(triggerBody()?['subject'],'/')?[7]}

这是我的流程和结果页面。

enter image description here enter image description here

希望这可以帮到你,如果你还有其他问题,请告诉我。

© www.soinside.com 2019 - 2024. All rights reserved.