我正在尝试删除/
在分配给输出变量值之前使用 azure 函数从 URL 获取
"webappStorageUri":{
"type": "string",
"value": "[take(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web, length(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web)-1]"
}
返回值来自length https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-array#length函数的值应该是take https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-array#take功能。这是行不通的。我在部署时收到以下错误。我没有从这个错误消息中得到任何信息。 Azure 是否支持链式函数执行?这是删除的正确方法吗/
从网址?
错误信息
[error]Deployment template language expression evaluation failed: 'Unable to parse language expression 'take(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web, length(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web)-1': expected token 'RightParenthesis' and actual 'Integer'.'. Please see https://aka.ms/arm-template-expressions for usage details.
我不确定你想要实现什么,但是你的函数有括号问题,并且你不能通过附加来真正减去-1
在一个随机的地方。
"[take(reference(variables('webappStorageName')).primaryEndpoints.web,
sub(length(reference(variables('webappStorageName')).primaryEndpoints.web), 1))]"
换行只是为了便于阅读
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)