如何在SFTP-SSH连接器(Azure逻辑应用程序)中创建多个触发器



当文件在逻辑应用中添加或修改sftp-ssh Connector时,只有一个触发器。在MS文档中提到我们可以有10个触发器。有人可以让我知道如何添加多个触发器到逻辑应用程序SFT_SSH连接器。

我已经尝试在代码视图的触发器部分添加更多的触发器,但它没有工作

我的方法——>添加了一个名称为_2的触发器。

{
"definition":{
"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions":{

},
"contentVersion":"1.0.0.0",
"outputs":{

},
"triggers":{
"When_files_are_added_or_modified_(properties_only)":{
"inputs":{
"host":{
"connection":{
"referenceName":"sftpwithssh_1"
}
},
"method":"get",
"path":"/datasets/default/triggers/batch/onupdatedfile",
"queries":{
"checkBothCreatedAndModifiedDateTime":false,
"folderId":"L1NGVFB0ZXN0",
"maxFileCount":10
}
},
"metadata":{
"L1NGVFB0ZXN0":"/SFTPtest"
},
"recurrence":{
"frequency":"Second",
"interval":10
},
"splitOn":"@triggerBody()",
"type":"ApiConnection"
},
"When_files_are_added_or_modified_(properties_only)_2":{
"inputs":{
"host":{
"connection":{
"referenceName":"sftpwithssh_1"
}
},
"method":"get",
"path":"/datasets/default/triggers/batch/onupdatedfile",
"queries":{
"checkBothCreatedAndModifiedDateTime":false,
"folderId":"L1NGVFB0ZXN9",
"maxFileCount":10
}
},
"metadata":{
"L1NGVFB0ZXN9":"/SFTPtest/Subfolder"
},
"recurrence":{
"frequency":"Second",
"interval":10
},
"splitOn":"@triggerBody()",
"type":"ApiConnection"
}
}
},
"kind":"Stateful"
}

你可以在逻辑应用中添加多个触发器。正如@Skin提到的,你只能在代码视图中添加多个触发器。如果逻辑应用程序包含多个触发器,它将无法在设计器视图中打开。我在我的逻辑应用程序中添加了两个sftp触发器。下面是我的逻辑应用程序的代码,有两个触发器,

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_files_are_added_or_modified_(properties_only)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['sftpwithssh']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/triggers/batch/onupdatedfile",
"queries": {
"checkBothCreatedAndModifiedDateTime": false,
"folderId": "6e202211-2856-4d17-9ded-5beb8b8626b0",
"maxFileCount": 10
}
},
"metadata": {
"6e202211-2856-4d17-9ded-5beb8b8626b0": "/"
},
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"splitOn": "@triggerBody()",
"type": "ApiConnection"
},
"When_files_are_added_or_modified_(properties_only)_2": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['sftpwithssh_1']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/triggers/batch/onupdatedfile",
"queries": {
"checkBothCreatedAndModifiedDateTime": false,
"folderId": "6e202211-2856-4d17-9ded-5beb8b8626b0",
"maxFileCount": 10
}
},
"metadata": {
"6e202211-2856-4d17-9ded-5beb8b8626b0": "/abc"
},
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"splitOn": "@triggerBody()",
"type": "ApiConnection"
}
}
},
"parameters": {
"$connections": {
"value": {
"sftpwithssh": {
"connectionId": "/subscriptions/xxx/resourceGroups/XXX/providers/Microsoft.Web/connections/sftpwithssh-1",
"connectionName": "sftpwithssh-1",
"id": "/subscriptions/xxx/providers/Microsoft.Web/locations/centralus/managedApis/sftpwithssh"
},
"sftpwithssh_1": {
"connectionId": "/subscriptions/xxxx/resourceGroups/so1/providers/Microsoft.Web/connections/sftpwithssh",
"connectionName": "sftpwithssh",
"id": "/subscriptions/xxxx/providers/Microsoft.Web/locations/centralus/managedApis/sftpwithssh"
}
}
}
}
}

我没有面对任何问题与上述代码。下面是逻辑应用中多个触发器的一些参考,link1link2link3

最新更新