[英]How to use parameters inside parameters.json file in Azure Logic App Workflow definition
I have a requirement to use the parameters inside the workflow parameters Object similar to below.我需要使用工作流参数 Object 中的参数,如下所示。 But I am failing with the Azure Validation.
但我在 Azure 验证方面失败了。
"parameters": {
"$apprelatedparams": {
"value": {
"testId": "<GUID>",
"testGroupName": "<GroupName>"
}
},
"$connections": {
"value": {
"connectionName": {
"connectionId": /test/@parameters['$apprelatedparams']['testId']/resourceGroups/@parameters['$apprelatedparams']['testGroupName']/providers/connectionName,
"id": /test/@parameters['$apprelatedparams']['testId']/providers/testName
}
}
}
}
Here is the complete workflow with parameters object -这是带有参数 object 的完整工作流程 -
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Response": {
"inputs": {
"body": "\"message\": \"Hello World!\"",
"statusCode": 200
},
"runAfter": {},
"type": "Response"
}
},
"contentVersion": "",
"outputs": {},
"parameters": {},
},
"parameters": {
"$apprelatedparams": {
"value": {
"testId": "TestID",
"testGroupName": "GroupName"
}
},
"$apprelatedparamstest": {
"value": {
"testsId": "@parameters['$apprelatedparams']['testId']",
"testGroupsName": "@parameters['$apprelatedparams']['testGroupName']"
}
}
}
}
Functions in expressions are called using parenthesis and not brackets. 表达式中的函数使用括号而不是方括号调用。 Therefore, you should transform your file into:
因此,您应该将文件转换为:
"parameters": {
"$apprelatedparams": {
"value": {
"testId": "<GUID>",
"testGroupName": "<GroupName>"
}
},
"$connections": {
"value": {
"connectionName": {
"connectionId": "/test/@parameters('apprelatedparams')['testId']/resourceGroups/@parameters('apprelatedparams')['testGroupName']/providers/connectionName",
"id": "/test/@parameters('apprelatedparams')['testId']/providers/testName"
}
}
}
}
See also Expressions for Workflow Definition Language as it explains what outputs you should expect depending on how you construct the call.另请参阅工作流定义语言的表达式,因为它解释了您应该期望的输出,具体取决于您构建调用的方式。
This is failing because of the structure of the json.由于 json 的结构,这是失败的。 Here is the json code that worked for me.
这是对我有用的 json 代码。
{
"parameters": {
"$apprelatedparams": {
"value": {
"testId": "<GUID>",
"testGroupName": "<GroupName>"
}
},
"$connections": {
"value": {
"connectionName": {
"connectionId": "test/@parameters['$apprelatedparams']['testId']/resourceGroups/@parameters['$apprelatedparams']['testGroupName']/providers/connectionName",
"id": "/test/@parameters['$apprelatedparams']['testId']/providers/testName"
}
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.