如何使用将消息发布到Slack的ARM模板将Logic App部署到Azure?

问题描述

我正在使用以下ARM模板制作一个将消息发布到Slack的逻辑应用程序。但是,当部署它时,我会收到一条“未找到连接”的消息(见图片)。

导致我无法找到连接的模板有什么问题?

{
"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdeFinition.json#","parameters":{
       "slack":{
          "defaultValue":"","type":"Object"
       }
    },"triggers":{
       "manual":{
          "inputs":{
             "schema":{
                "$schema":"http://json-schema.org/draft-04/schema#","properties":{
                   "context":{
                      "properties":{
                         "name":{
                            "type":"string"
                         },"portalLink":{
                            "type":"string"
                         },"resourceName":{
                            "type":"string"
                         }
                      },"required":[
                         "name","portalLink","resourceName"
                      ],"type":"object"
                   },"status":{
                      "type":"string"
                   }
                },"required":[
                   "status","context"
                ],"type":"object"
             }
          },"kind":"Http","type":"Request"
       }
    },"actions":{
       "Post_message":{
          "runAfter":{
 
          },"type":"ApiConnection","inputs":{
             "host":{
                "connection":{
                   "name":"Hard-coded name here"
                }
             },"method":"post","path":"/chat.postMessage","queries":{
                "channel":"slack-channel-name","text":"This is a test :) "
             }
          }
       }
    },"outputs":{
 
    }
 }

我正在使用Python工作流软件包在单独的脚本中添加参数,该脚本从以下位置导入:

azure.mgmt.logic.models import Workflow

这似乎行得通,因为Logic App部署得很好,只是缺少连接。

enter image description here

解决方法

之所以发生这种情况,是因为您尚未创建{ "query": { "bool": { "must": [ { "term": { "entity_type": "suggestions" } },{ "term": { "document_type": "vertex" } },{ "match": { "predicates.suggestion.value": "life" } } ] } } } 并将其详细信息添加到Logic App中。 Logic App ARM的外观应类似于:

Slack connector

应在此处添加松弛连接器:

enter image description here