Azure Logic App "When a HTTP request is received" 连接器多个相对路径

Azure Logic App "When a HTTP request is received" Connector multiple relative paths

一个逻辑应用程序是否可以有多个端点。 例如:

https://azure-url/invoke/customers/all
https://azure-url/invoke/customers/{specific_id}
https://azure-url/invoke/customers/{specific_id}/brand/all
https://azure-url/invoke/customers/{specific_id}/brand/{brand_id}

如何在一个逻辑应用程序中使用 single/multiple HTTP 接收器来实现这一点?

对于这个需求,可以在azure中使用"API Management"。请参考以下步骤:

1. 按照此 tutorial.

创建一个 API 管理

2. 转到您的 API 管理并从逻辑应用程序添加 api。

3.在里面选择你的logic app,然后创建。

4.我们可以看到它的"Frontend",点击铅笔进行编辑。

5.将"URL"编辑成你想要的,保存。

6. 可以在"Test"标签下得到请求url。

7. 之后可以按照上面同样的步骤添加另外三个api,只需要编辑[=50=的"URL" ] 随心所欲。如果你想输入{specific_id},只需编辑"URL"如下:

/manual/paths/invoke/customers/{specific_id}
/manual/paths/invoke/customers/{specific_id}/brand/all
/manual/paths/invoke/customers/{specific_id}/brand/{brand_id}

希望对你有帮助~

我的问题有一个解决方法,我们不能为一个逻辑应用程序设置多个路径参数,但我们可以在逻辑应用程序上使用 API 管理顶部。 在APIM,

  1. 需要为每个PATH参数创建不同的操作Operation with TWO Path paramOperation with ONE path paramOperation with THREE path param

  2. 将 APIM 路径参数值作为策略添加到后端

    <set-query-parameter name="vendor_id" exists-action="override">
    <value>@(context.Request.MatchedParameters["vendor_id"])</value>
    </set-query-parameter>

    <set-query-parameter name="brand_id" exists-action="override">
    <value />
    </set-query-parameter>

    <set-query-parameter name="family_id" exists-action="override">
    <value />
    </set-query-parameter>

在上面的代码中,如果路径参数没有值,我们需要传递一个空字符串。