从逻辑应用程序调用的 azure 函数的 ID 中使用参数时出错
Error while using a parameter within the id of a called azure function from a logic app
我在不同的阶段有不同的天蓝色功能,
当我部署我的逻辑应用程序时,我想配置调用什么 azure 函数。
我添加了一个名为:
的新参数
"unzip_gzip_path": {
"value": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXXTest/providers/Microsoft.Web/sites/FunctionApp201806XXXXXXXX/functions/Function1"
}
然后像这样在arm模板中使用他:
"$functions_paths": {
"value": {
"unzip_gzip": {
"path": "[parameters('unzip_gzip_path')]"
}
}
}
Azure 函数调用是这样的:
"Function1":{
"type": "Function",
"inputs": {
"body": "@items('For_each_attachment')?['ContentBytes']",
"method": "POST",
"function": {
"id": "@parameters('$functions_paths')['unzip_gzip']['path']"
}
},
"runAfter": {}
}
现在我收到错误
15:31:34 - 15:31:33 - Resource Microsoft.Logic/workflows 'DMARCReportingProcessingLogicApp' failed with message '{
15:31:34 - "error": {
15:31:34 - "code": "LinkedInvalidPropertyId",
15:31:34 - "message": "Property id '@parameters('$functions_paths')['unzip_gzip']['path']' at path 'properties.definition.actions.For_each_attachment.actions.Condition.actions.Function1.inputs.function.id' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
15:31:34 - }
15:31:34 - }'
难道我不能在函数位置使用参数?
目前函数的资源ID只能在部署时设置,不能在运行时设置。设置它的正确方法是作为 ARM 参数而不是逻辑应用程序参数(如果有意义的话)。
Here's an example 为部署参数化的一个。
{
"Azure_Function": {
"type": "Function",
"inputs": {
"body": "@triggerBody()",
"function": {
"id": "[resourceId('Microsoft.Web/sites/functions', parameters('functionAppName'), variables('functionName'))]"
}
},
"runAfter": {}
}
我在不同的阶段有不同的天蓝色功能, 当我部署我的逻辑应用程序时,我想配置调用什么 azure 函数。
我添加了一个名为:
的新参数"unzip_gzip_path": {
"value": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXXTest/providers/Microsoft.Web/sites/FunctionApp201806XXXXXXXX/functions/Function1"
}
然后像这样在arm模板中使用他:
"$functions_paths": {
"value": {
"unzip_gzip": {
"path": "[parameters('unzip_gzip_path')]"
}
}
}
Azure 函数调用是这样的:
"Function1":{
"type": "Function",
"inputs": {
"body": "@items('For_each_attachment')?['ContentBytes']",
"method": "POST",
"function": {
"id": "@parameters('$functions_paths')['unzip_gzip']['path']"
}
},
"runAfter": {}
}
现在我收到错误
15:31:34 - 15:31:33 - Resource Microsoft.Logic/workflows 'DMARCReportingProcessingLogicApp' failed with message '{
15:31:34 - "error": {
15:31:34 - "code": "LinkedInvalidPropertyId",
15:31:34 - "message": "Property id '@parameters('$functions_paths')['unzip_gzip']['path']' at path 'properties.definition.actions.For_each_attachment.actions.Condition.actions.Function1.inputs.function.id' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
15:31:34 - }
15:31:34 - }'
难道我不能在函数位置使用参数?
目前函数的资源ID只能在部署时设置,不能在运行时设置。设置它的正确方法是作为 ARM 参数而不是逻辑应用程序参数(如果有意义的话)。
Here's an example 为部署参数化的一个。
{
"Azure_Function": {
"type": "Function",
"inputs": {
"body": "@triggerBody()",
"function": {
"id": "[resourceId('Microsoft.Web/sites/functions', parameters('functionAppName'), variables('functionName'))]"
}
},
"runAfter": {}
}