Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure logic apps Microsoft Flow自定义连接器webhook触发器定义和实现:创建流后找不到404_Azure Logic Apps_Power Automate - Fatal编程技术网

Azure logic apps Microsoft Flow自定义连接器webhook触发器定义和实现:创建流后找不到404

Azure logic apps Microsoft Flow自定义连接器webhook触发器定义和实现:创建流后找不到404,azure-logic-apps,power-automate,Azure Logic Apps,Power Automate,我正在尝试在Microsoft Flow中为我的API创建一个自定义连接器,以便用户可以基于webhook实现触发流。 身份验证部分似乎工作正常(我能够创建连接)。在使用自定义触发器创建流之后,它永远不会被触发。在检查我端的数据时,Flow似乎无法正确注册订阅 如果导航到流的管理页面,则会收到以下错误消息。 当我单击修复触发器时,我得到以下详细信息,其中Id参数与我们试图订阅的资源的Id匹配。 以下是触发器定义: { "/AlertRules/{id}/webhooks": { "

我正在尝试在Microsoft Flow中为我的API创建一个自定义连接器,以便用户可以基于webhook实现触发流。 身份验证部分似乎工作正常(我能够创建连接)。在使用自定义触发器创建流之后,它永远不会被触发。在检查我端的数据时,Flow似乎无法正确注册订阅 如果导航到流的管理页面,则会收到以下错误消息。
当我单击修复触发器时,我得到以下详细信息,其中Id参数与我们试图订阅的资源的Id匹配。
以下是触发器定义:

{
"/AlertRules/{id}/webhooks": {
      "x-ms-notification-content": {
        "schema": {
          "type": "object",
          "properties": {
            "Title": {
              "type": "string",
              "description": "Title"
            },
            "Text": {
              "type": "string",
              "description": "Text"
            },
            "Data": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DataApi.Models.AlertEvent"
              },
              "description": "Data"
            }
          }
        },
        "description": ""
      },
      "post": {
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
                "type": "string"
            }
          }
        },
        "x-ms-trigger": "single",
        "operationId": "NewAlertEvent",
        "summary": "When a new Alert Event is created or updated",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "x-ms-visibility": "important",
            "x-ms-dynamic-values": {
              "operationId": "AlertRules.AlertRule.ListAlertRule",
              "value-path": "Id",
              "value-collection": "value",
              "value-title": "Description"
            }
          },
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "string",
              "x-ms-visibility": "internal",
              "title": "",
              "x-ms-notification-url": true
            },
            "x-ms-visibility": "internal"
          }
        ]
      }
}
我的删除操作的说明

{
"/AlertRuleSubscriptions({Id})": {
"delete": {
        "tags": [
          "AlertRuleSubscriptions.AlertRuleSubscription"
        ],
        "summary": "Delete entity from AlertRuleSubscriptions",
        "operationId": "AlertRuleSubscriptions.AlertRuleSubscription.DeleteAlertRuleSubscription",
        "parameters": [
          {
            "in": "path",
            "name": "Id",
            "description": "key: Id",
            "required": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "x-ms-docs-key-type": "AlertRuleSubscription"
          },
          {
            "in": "header",
            "name": "If-Match",
            "description": "ETag",
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "$ref": "#/responses/error"
          }
        },
        "x-ms-docs-operation-type": "operation"
      }
}
}
并且我的post操作会使用与上述删除操作的格式匹配的位置标头进行回复。
我的问题是:

  • 我的触发器声明中缺少什么
  • 如何获取有关订阅创建和Microsoft Flow生成的错误的更多详细信息

在与微软进行一些内部讨论后,我们发现了两个主要问题。
首先,我更新了POST请求的body参数,以创建对此的订阅


       {
        "name": "body",
        "in": "body",
        "required": false,
        "schema": {
         "type": "object",
         "properties": {
          "callbackUrl": {
           "type": "string",
           "required": true,
           "description": "callbackUrl",
           "x-ms-notification-url": true,
           "x-ms-visibility": "internal"
          }
         }
        }
       }

这是因为连接器定义不支持在不使用JSON格式的情况下在正文中发送回调URL,并且因为实现了流

其次,我更新了API以支持上述规范