【发布时间】:2016-06-28 18:31:23
【问题描述】:
我正在尝试从模板中其他地方使用的存储帐户构建连接字符串,我有
"StorageConnectionString": {
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',
variables('storageName'),';AccountKey=',
listKeys(resourceId('Microsoft.Storage/storageAccounts',
variables('storageName')), providers('Microsoft.Storage',
'storageAccounts').apiVersions[0]).key1)]",
"type": "Custom"
},
我从ARM - How can I get the access key from a storage account to use in AppSettings later in the template? 找到的,但是该问题中的语法似乎不再有效。我得到一个错误,key1 不是已知的属性。显然有一个名为keys 的属性,但正如人们所预料的那样,它是某种结构。我一直无法从该结构中弄清楚主键的属性是什么。我试过了
- key1 -> 模板语言表达式属性“key1”不存在,可用属性为“keys”
- keys -> 为模板语言函数“concat”提供的参数无效。所有参数都必须是数组,或者没有参数必须是数组。
- keys.key1
- keys.primaryKey
- 键[0]
所有这些都失败了。我尝试在文件末尾放置一个output,但输出键似乎没有输出任何值。
【问题讨论】:
标签: azure azure-storage azure-resource-manager azure-storage-account arm-template