我试图借助下面列出的ARM模板部署Redis-然后返回其主键(Azure门户中Redis的秘密字符串在“访问键”->“主”下):
但是我从管道“ AzureResourceManagerTemplateDeployment @ 3”任务中收到错误消息:
[[错误]无法评估模板输出:'RedisCachePassword'。请查看错误详细信息和部署操作。请参阅https://aka.ms/arm-debug了解详细用法。
[错误]详细信息:
[[error] DeploymentOutputEvaluationFailed:模板输出'RedisCachePassword'无效:无法评估语言表达式属性'primaryKey'。]]
下面的我的ARM模板有什么问题?在这种情况下如何找到正确的名称?
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "redisCacheName": { "defaultValue": "my-redis", "type": "String" } }, "variables": { "resourceName": "[concat(resourceGroup().name, '-', parameters('redisCacheName'))]" }, "outputs": { "RedisCacheEndpoint": { "type": "string", "value": "[concat(reference(variables('resourceName')).hostName, ':', reference(variables('resourceName')).sslPort)]" }, "RedisCachePassword": { "type": "string", "value": "[reference(variables('resourceName')).accessKeys.primaryKey]" } }, "resources": [ { "type": "Microsoft.Cache/Redis", "apiVersion": "2019-07-01", "name": "[variables('resourceName')]", "location": "[resourceGroup().location]", "properties": { "sku": { "name": "Basic", "family": "C", "capacity": 1 }, "enableNonSslPort": false } } ] }
为什么
[reference(variables('resourceName')).accessKeys.primaryKey]
不起作用?
我正在尝试使用下面列出的ARM模板来部署Redis-然后返回其主键(Azure门户中Redis的秘密字符串在“访问键”->“主”下可用:...] >