![](/img/trans.png)
[英]Azure ARM Template - accessing a resource Id created by one ARM template in another ARM template
[英]Difference between concat function and resource id function in Azure ARM Template
谁能告诉我这两者之间有什么区别,以及应该在 Azure ARM JSON 模板的资源部分中使用哪一个
"dependsOn": [
[concat('Microsoft.Compute/availabilitySets/', variables('availabilitySetName'))]"
"dependsOn": [
[resourceid('Microsoft.Compute/availabilitySets/', variables('availabilitySetName'))]"
resourceId 只是一种生成 resourceId 的便捷方式,而不是“假”的方式,因为如果您尝试将 concat 示例与任何需要 resourceId 的 function\\resource 属性一起使用,则您所展示的示例仅适用于dependsOn 属性将失败。
基本上,dependsOn 在解析输入时允许使用几个快捷方式,因此您可以执行以下操作:
dependsOn: [
"resourceName"
]
如果该名称是唯一的 - 那很好。 但它不是您可能认为的真正的 resourceId。
连接: https : //docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-array#concat
资源ID : https : //docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource#resourceid
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.