Azure 使用ARM获取别名命名空间的ConnectionString
我正在使用ARM模板部署一些带有GeoRecovery的EventHub。我正在尝试将Alias ConnectionString作为输出的一部分 我计划使用这些函数。但是我不知道如何在ARM模板上使用它。我已经寻找并尝试了所有可能的方法,但无法绕过它。我用这个,Azure 使用ARM获取别名命名空间的ConnectionString,azure,azure-resource-manager,Azure,Azure Resource Manager,我正在使用ARM模板部署一些带有GeoRecovery的EventHub。我正在尝试将Alias ConnectionString作为输出的一部分 我计划使用这些函数。但是我不知道如何在ARM模板上使用它。我已经寻找并尝试了所有可能的方法,但无法绕过它。我用这个, listKeys(resourceId(parameters('ResourceGroupName'), _ concat('Microsoft.EventHub/namespaces/disasterRecover
listKeys(resourceId(parameters('ResourceGroupName'), _
concat('Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules'), _
parameters('AliasNamespaceName'), 'RootManageSharedAccessKey'),'2015-08-01').primaryConnectionString
但是我得到一个错误->
: Deployment template validation failed: 'The template resource 'myresource' at line '90' and column '5' is not valid: Unable to evaluate template language function 'resourceId': the type 'Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules' requires '3' resource name argument(s). Please see https://aka.ms/arm-template-expressions/#resourceid for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.'.
有人能帮我在ARM模板中获取ListKey吗 这看起来段长度不正确-模板问题无效。要解决此问题,您需要为正在使用的类型提供3个资源名称参数,即“Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules”。有关更多说明,请参考提供的示例
希望这有帮助!干杯 这看起来段长度不正确-模板问题无效。要解决此问题,您需要为正在使用的类型提供3个资源名称参数,即“Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules”。有关更多说明,请参考提供的示例
希望这有帮助!干杯 这就是你必须做的:
listKeys(resourceId(parameters('ResourceGroupName'), 'Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules', %namespacename%, %disasterrecoveryconfigname%, 'RootManageSharedAccessKey'), '2015-08-01').primaryConnectionString
这就是你必须做的:
listKeys(resourceId(parameters('ResourceGroupName'), 'Microsoft.EventHub/namespaces/disasterRecoveryConfigs/authorizationRules', %namespacename%, %disasterrecoveryconfigname%, 'RootManageSharedAccessKey'), '2015-08-01').primaryConnectionString
下面的代码帮助了我
“[ListKey(resourceId('Microsoft.Eventhub/namespaces/Eventhub/authorizationRules',参数('eventHubNamespaceNamePrimary'),参数('EventHubName'),'EventWriter'),'2017-04-01')。别名PrimaryConnectionString]”
下面的代码帮助了我
“[ListKey(resourceId('Microsoft.Eventhub/namespaces/Eventhub/authorizationRules',参数('eventHubNamespaceNamePrimary'),参数('EventHubName'),'EventWriter'),'2017-04-01')。别名PrimaryConnectionString]”
裁判