将事件中心地理恢复DR别名引用为命名空间

问题描述

我们有一个DeployIfNotExists策略,该策略在环境中的资源上创建诊断设置。该策略包含诊断设置的ARM模板,该模板在评估后触发该设置,该触发器在资源上不存在。请参见下面:(这是Azure堡垒主机的一个示例设置)

    "resources": [
            {
              "type": "Microsoft.Network/bastionHosts/providers/diagnosticSettings","apiVersion": "2017-05-01-preview","name": "[concat(parameters('resourceName'),'/Microsoft.Insights/',parameters('profileName'))]","location": "[parameters('location')]","dependsOn": [],"properties": {
                "eventHubAuthorizationRuleId": "[parameters('eventHubRuleId')]","eventHubName": "[parameters('eventHubName')]","logs": [
                  {
                    "category": "BastionAuditLogs","enabled": true
                  }
                ]
              }
            }
          ],

“事件中心授权规则ID”的一行,我们传入了一个参数。之前,我们只是传递了主要Event Hub的信息。但是,位于不同区域中的某些资源将失败,因为它们无法将跨区域写入事件中心。因此,现在我们正在使用地理恢复别名。

我们有一个Geo-Recovery DR别名,可在两个不同的区域中连接主要/次要事件中心。我想通过此DR别名的EventHubAuthorizationRuleID,但是这样做时会出现以下问题:

    Resource type 'microsoft.eventhub/namespaces/disasterrecoveryconfigs/authorizationrules' is invalid for property 'properties.eventHubAuthorizationRuleId'. Expected types are 'microsoft.servicebus/namespaces/authorizationrules','microsoft.eventhub/namespaces/authorizationrules

我们使用以下Powershell命令获取DR别名的授权规则:

    PS: Get-AzEventHubAuthorizationRule -AliasName xxxxxxxxxxxxxx -Namespace xxxxxxxxxxxx -ResourceGroupName xxxxxxxxxxxxxxxx


    Id       : /subscriptions/xxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.EventHub/namespaces/xxxxxxxxxxx/disasterRecoveryConfigs/xxxxxxxxxxxxxxx/AuthorizationRules/RootManageSharedAccessKey
    Type     : Microsoft.EventHub/Namespaces/AuthorizationRules
    Name     : RootManageSharedAccessKey
    Location : 
    Tags     : 
    Rights   : {Listen,Manage,Send}

上面的ID是我们作为参数传入的,并导致失败。 Powershell响应中的类型为“ Microsoft.EventHub / Namespaces / AuthorizationRules”,即使它明确包含“ disasterRecoveryConfigs”部分。

问题:我们如何引用DR别名,以便将其读取为常规名称空间?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...