使用具有Active Directory集成的ARM模板部署服务结构时出错

时间:2018-10-06 10:57:27

标签: azure-active-directory azure-service-fabric arm-template

我想使用带有AD集成的ARM模板设置Service Fabric群集。我正在按照给出的说明进行操作 https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-creation-create-template

我收到以下错误

  

message“:”不应同时定义通用名称和指纹   特定证书。”,

{
   "apiVersion":"2018-02-01",
   "type":"Microsoft.ServiceFabric/clusters",
   "name":"[parameters('clusterName')]",
   "location":"[parameters('clusterLocation')]",
   "dependsOn":[
      "[concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName'))]"
   ],
   "properties":{
      "addonFeatures":[
         "DnsService",
         "RepairManager"
      ],
      "certificate":{
         "thumbprint":"[parameters('certificateThumbprint')]",
         "x509StoreName":"[parameters('certificateStoreValue')]"
      },
      "certificateCommonNames":{
         "commonNames":[
            {
               "certificateCommonName":"[parameters('certificateCommonName')]",
               "certificateIssuerThumbprint":""
            }
         ],
         "x509StoreName":"[parameters('certificateStoreValue')]"
      },
      "azureActiveDirectory":{
         "tenantId":"[parameters('aadTenantId')]",
         "clusterApplication":"[parameters('aadClusterApplicationId')]",
         "clientApplication":"[parameters('aadClientApplicationId')]"
      },
      "clientCertificateCommonNames":[

      ],
      "clientCertificateThumbprints":[

      ],
      "clusterState":"Default",
      "diagnosticsStorageAccountConfig":{
         "blobEndpoint":"[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.blob]",
         "protectedAccountKeyName":"StorageAccountKey1",
         "queueEndpoint":"[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.queue]",
         "storageAccountName":"[parameters('supportLogStorageAccountName')]",
         "tableEndpoint":"[reference(concat('Microsoft.Storage/storageAccounts/', parameters('supportLogStorageAccountName')), variables('storageApiVersion')).primaryEndpoints.table]"
      },
      "fabricSettings":[
         {
            "parameters":[
               {
                  "name":"ClusterProtectionLevel",
                  "value":"[parameters('clusterProtectionLevel')]"
               }
            ],
            "name":"Security"
         }
      ],
      "managementEndpoint":"[concat('https://',reference(concat(parameters('lbIPName'),'-','0')).dnsSettings.fqdn,':',parameters('nt0fabricHttpGatewayPort'))]",
      "nodeTypes":[
         {
            "name":"[parameters('vmNodeType0Name')]",
            "applicationPorts":{
               "endPort":"[parameters('nt0applicationEndPort')]",
               "startPort":"[parameters('nt0applicationStartPort')]"
            },
            "clientConnectionEndpointPort":"[parameters('nt0fabricTcpGatewayPort')]",
            "durabilityLevel":"Bronze",
            "ephemeralPorts":{
               "endPort":"[parameters('nt0ephemeralEndPort')]",
               "startPort":"[parameters('nt0ephemeralStartPort')]"
            },
            "httpGatewayEndpointPort":"[parameters('nt0fabricHttpGatewayPort')]",
            "isPrimary":true,
            "reverseProxyEndpointPort":"[parameters('nt0reverseProxyEndpointPort')]",
            "vmInstanceCount":"[parameters('nt0InstanceCount')]"
         }
      ],
      "provisioningState":"Default",
      "reliabilityLevel":"Silver",
      "upgradeMode":"Automatic",
      "vmImage":"Windows"
   },
   "tags":{
      "resourceType":"Service Fabric",
      "clusterName":"[parameters('clusterName')]"
   }
}

2 个答案:

答案 0 :(得分:0)

错误说明了一切,请删除模板的证书部分

  "certificate":{
     "thumbprint":"[parameters('certificateThumbprint')]",
     "x509StoreName":"[parameters('certificateStoreValue')]"
  },

答案 1 :(得分:0)

错误消息清晰Common names and thumbprints should not be both defined for a particular certificatedocs清楚地表明,如果您想按通用名称查找证书,则必须删除证书指纹设置

它在第1步中提到了

  
      
  1. 在“参数”部分中,添加一个certificateCommonName参数:...   也可以考虑删除证书缩略图,它可能不再是   需要。
  2.   

第2步

  
      
  1. 添加“ commonNames”:[“ [parameters('certificateCommonName')]”]],和   删除“ thumbprint”:“ [parameters('certificateThumbprint')]”,。
  2.   

和3

  
      
  1. 添加具有commonNames属性的certificateCommonNames设置,然后   删除证书设置(具有指纹属性),方法如下   以下示例:
  2.