尝试启动逻辑应用触发器时出错

时间:2021-05-18 12:27:32

标签: azure azure-logic-apps

enter image description here我正在尝试使用事件网格触发器配置逻辑应用程序。触发器应该是当我的密钥保管库中的 Azure CMK 即将到期时,它应该向我发送电子邮件。我已经使用逻辑应用程序设计器配置了逻辑应用程序,但是当我尝试运行触发器时,它向我抛出错误,如屏幕截图所示。

enter image description here

我的设计师的截图也附上了。知道我需要做什么来解决这个问题[![在此处输入图片描述][3]][3]

也把代码放在这里以供参考。

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Send_an_email_(V2)": {
                "inputs": {
                    "body": {
                        "Body": "<p>Your CMK will expire in 30 days</p>",
                        "ReplyTo": "myemailaddress ",
                        "Subject": "Key Expiry",
                        "To": "myemailaddress"
                    },
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['outlook']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/v2/Mail"
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_a_resource_event_occurs": {
                "inputs": {
                    "body": {
                        "properties": {
                            "destination": {
                                "endpointType": "webhook",
                                "properties": {
                                    "endpointUrl": "@{listCallbackUrl()}"
                                }
                            },
                            "filter": {
                                "includedEventTypes": [
                                    "Microsoft.KeyVault.KeyNearExpiry"
                                ]
                            },
                            "topic": "/subscriptions/<subscriptionid>/resourceGroups/pallabdev/providers/Microsoft.KeyVault/vaults/testhalvault"
                        }
                    },
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['azureeventgrid_1']['connectionId']"
                        }
                    },
                    "path": "/subscriptions/@{encodeURIComponent('subscriptionId')}/providers/@{encodeURIComponent('Microsoft.KeyVault.vaults')}/resource/eventSubscriptions",
                    "queries": {
                        "x-ms-api-version": "2017-06-15-preview"
                    }
                },
                "splitOn": "@triggerBody()",
                "type": "ApiConnectionWebhook"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "azureeventgrid_1": {
                    "connectionId": "/subscriptions/<subscriptionId>/resourceGroups/PallabDev/providers/Microsoft.Web/connections/azureeventgrid",
                    "connectionName": "azureeventgrid",
                    "connectionProperties": {
                        "authentication": {
                            "type": "ManagedServiceIdentity"
                        }
                    },
                    "id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/canadacentral/managedApis/azureeventgrid"
                },
                "outlook": {
                    "connectionId": "/subscriptions/<subscriptionId>/resourceGroups/PallabDev/providers/Microsoft.Web/connections/outlook",
                    "connectionName": "outlook",
                    "id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/canadacentral/managedApis/outlook"
                }
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

原因是triggerbodynull,它必须是array,如果是null,它会导致你的错误。

根据评论区的讨论,关闭Split On可以避免这个错误。