Azure模板验证失败,表达式无效

Azure模板验证失败,表达式无效,azure,azure-logic-apps,azure-resource-manager,Azure,Azure Logic Apps,Azure Resource Manager,我已导出一个资源组,其中包含一些我想在Visual Studio中使用的逻辑应用程序,但无法使用VS中的designer视图打开一个逻辑应用程序 即使我没有以任何方式修改代码,也会出现此错误: 模板验证失败:“属性”表达式“”[concat('@equals(toLower(triggerBody()?['',参数('workflows_Booking_name'),'s']?['Event'],'create'))]”” 第“1”行和第“1827”列的模板操作“Condition_-_Crea

我已导出一个资源组,其中包含一些我想在Visual Studio中使用的逻辑应用程序,但无法使用VS中的designer视图打开一个逻辑应用程序

即使我没有以任何方式修改代码,也会出现此错误:

模板验证失败:“属性”表达式“”[concat('@equals(toLower(triggerBody()?['',参数('workflows_Booking_name'),'s']?['Event'],'create'))]”” 第“1”行和第“1827”列的模板操作“Condition_-_Create_或_UpdateBookings”不是有效的模板语言表达式。“”

为了更好地理解,这就是Logic应用程序在门户中的外观。

正如Szymon Wylezol提到的,模板本身似乎有问题。从错误消息中我们知道表达式
[concat('@equals(toLower(triggerBody()?['',parameters('workflows\u Booking\u name'),'s']?['Event'],'create'))不正确。
。有关表达式的更多详细信息,请参阅

根据您提供的屏幕截图,我们可以在代码视图中获得如下表达式:

"actions": {
    "Condition_-_Create_or_UpdateBookings": {
      "type": "If",
      "expression": "@equals(toLower(triggerBody()?['Bookings']?['Event']), 'create')",
      "actions": {},
      "runAfter": {}
    }
  }
请将VS中的代码视图与Azure门户中的代码视图进行比较

然后它就可以在VisualStudio中查看了。有关在Visual Studio中设计、构建和部署Azure Logic应用程序的更多详细信息,请参阅

演示代码

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "workflows_testlogic_name": {
            "defaultValue": "testlogic",
            "type": "string"
        },
        "workflows_tomtestLogicApp_name": {
            "defaultValue": "tomtestLogicApp",
            "type": "string"
        }
    },
    "variables": {},
    "resources": [
        {
            "comments": "Generalized from resource: '/subscriptions/ed0caab7-c6d4-45e9-9289-c7e5997c9241/resourceGroups/tomtestlogicApp/providers/Microsoft.Logic/workflows/testlogic'.",
            "type": "Microsoft.Logic/workflows",
            "name": "[parameters('workflows_testlogic_name')]",
            "apiVersion": "2016-06-01",
            "location": "eastasia",
            "properties": {
                "state": "Enabled",
                "definition": {
                    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
                    "contentVersion": "1.0.0.0",
                    "parameters": {},
                    "triggers": {
                        "manual": {
                            "type": "Request",
                            "kind": "Http",
                            "inputs": {
                                "schema": {
                                    "properties": {
                                      "event": {
                                        "type": "string",
                                        "value": ""
                                      },
                                        "name": {
                                            "type": "string",
                                            "value": ""
                                        },
                                        "participants": {
                                            "type": "integer",
                                            "value": ""
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "actions": {
                        "Condition": {
                            "actions": {},
                            "runAfter": {},
                            "expression": "@equals(toLower(triggerBody()?['name']), 'test')",
                            "type": "If"
                        }
                    },
                    "outputs": {}
                },
                "parameters": {}
            },
            "dependsOn": []
        },
        {
            "comments": "Generalized from resource: '/subscriptions/ed0caab7-c6d4-45e9-9289-c7e5997c9241/resourceGroups/tomtestlogicApp/providers/Microsoft.Logic/workflows/tomtestLogicApp'.",
            "type": "Microsoft.Logic/workflows",
            "name": "[parameters('workflows_tomtestLogicApp_name')]",
            "apiVersion": "2016-06-01",
            "location": "eastasia",
            "tags": {
                "displayName": "LogicApp"
            },
            "properties": {
                "state": "Enabled",
                "definition": {
                    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
                    "contentVersion": "1.0.0.0",
                    "parameters": {},
                    "triggers": {
                        "manual": {
                            "type": "Request",
                            "kind": "Http",
                            "inputs": {
                                "schema": {
                                    "properties": {
                                        "Bookings": {
                                            "properties": {
                                                "BookedByEmail": {
                                                    "type": "string"
                                                },
                                                "Event": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "actions": {
                        "Condition_-_Create_or_UpdateBookings": {
                            "actions": {},
                            "runAfter": {},
                            "expression": "@equals(toLower(triggerBody()?['Bookings']?['Event']), 'create')",
                            "type": "If"
                        }
                    },
                    "outputs": {}
                },
                "parameters": {}
            },
            "dependsOn": []
        }
    ]
}

看起来模板本身有问题。如果仔细查看错误消息,表达式包含[concat(“…”)],它看起来像ARM模板表达式,而不是逻辑应用程序定义表达式。您能否在代码视图中查看并确认情况是否如此(并与原始逻辑应用程序确认是否相同)?您能否共享该模板?