Azure Logic应用-动态API连接 [英] Azure Logic App - Dynamic API Connection

查看:49
本文介绍了Azure Logic应用-动态API连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以动态选择我要使用的FTP API连接? 我们在同一资源组中定义了两个FTP API连接,名称分别为ftptest1和ftptest2.

如何在Logic App的代码视图中选择其中之一? 我只能在设计器中选择连接,然后创建连接"ftp".请参见下面的代码段.

但是我需要根据一个参数动态选择两个FTP连接之一.

"inputs": {
            "body": "@body('XMLFile')",
            "host": {
                "api": {
                    "runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/ftp"
                },
                "connection": {
                     "name": "@parameters('$connections')['ftp']['connectionId']"
                }
            },

是否可以更改"@ parameters('$ connections')['ftp'] ['connectionId']" 并通过名称或其他方式在其中选择现有的API连接?/p>

谢谢!

解决方案

您应该添加一个条件,在此之后,将有两个FTP连接器使用不同的连接.这应该使其具有动态性.定义中有多少个动作是免费的.我们根据动作执行来收费,在这种情况下,该动作将被计为一个(ftp1或ftp2).

Is it possible to dynamically choose the FTP API connection that I want to use? We have defined two FTP API connections in the same resource group, with name ftptest1 and ftptest2.

How can I select one of these in the code view of the Logic App? I'm only able to select the connection in the designer and then connection 'ftp' is created. See code snippet below.

But I need to dynamically select one of the two FTP connections based on a parameter.

"inputs": {
            "body": "@body('XMLFile')",
            "host": {
                "api": {
                    "runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/ftp"
                },
                "connection": {
                     "name": "@parameters('$connections')['ftp']['connectionId']"
                }
            },

Is it possible to change the "@parameters('$connections')['ftp']['connectionId']" and select an existing API Connection there by name or something else?

Thank you!

解决方案

You should add a condition after which there will two FTP connectors each using different connection. This should make it dynamic. There is no charge on how many actions are in the definition. We charge on the basis of action execution which in this case will be counted one (either ftp1 or ftp2).

这篇关于Azure Logic应用-动态API连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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