【问题标题】:How to Get Visual Studio to Publish an Application to Service Fabric Cluster Secured by Certificate Common Name Instead of Thumbprint?如何让 Visual Studio 将应用程序发布到由证书公用名而不是指纹保护的 Service Fabric 群集?
【发布时间】:2019-03-07 21:28:45
【问题描述】:

我按照here 记录的步骤将我现有的 ARM 模板转换为使用公用名设置而不是指纹。部署成功,在典型的证书选择弹出窗口后,我能够使用浏览器连接到 Service Fabric Explorer。接下来,我尝试像以前一样将应用程序部署到集群中。即使我可以在 VS 公共服务结构应用程序对话框中看到集群连接端点 URI,VS 也无法连接到集群。之前,我会得到一个提示,允许 VS 访问本地证书。有谁知道如何让 VS 使用证书公用名将应用程序部署到服务结构集群设置?

摘自上面的 MS 链接:

"virtualMachineProfile": {
  "extensionProfile": {
    "extensions": [`enter code here`
      {
        "name": "[concat('ServiceFabricNodeVmExt','_vmNodeType0Name')]",
        "properties": {
          "type": "ServiceFabricNode",
          "autoUpgradeMinorVersion": true,
          "protectedSettings": {
            "StorageAccountKey1": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('supportLogStorageAccountName')),'2015-05-01-preview').key1]",
            "StorageAccountKey2": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('supportLogStorageAccountName')),'2015-05-01-preview').key2]"
          },
          "publisher": "Microsoft.Azure.ServiceFabric",
          "settings": {
            "clusterEndpoint": "[reference(parameters('clusterName')).clusterEndpoint]",
            "nodeTypeRef": "[variables('vmNodeType0Name')]",
            "dataPath": "D:\\SvcFab",
            "durabilityLevel": "Bronze",
            "enableParallelJobs": true,
            "nicPrefixOverride": "[variables('subnet0Prefix')]",
            "certificate": {
              "commonNames": [
                 "[parameters('certificateCommonName')]"
              ],
              "x509StoreName": "[parameters('certificateStoreValue')]"
            }
          },
          "typeHandlerVersion": "1.0"
        }
      },

{
    "apiVersion": "2018-02-01",
    "type": "Microsoft.ServiceFabric/clusters",
    "name": "[parameters('clusterName')]",
    "location": "[parameters('clusterLocation')]",
    "dependsOn": [
    "[concat('Microsoft.Storage/storageAccounts/', variables('supportLogStorageAccountName'))]"
    ],
    "properties": {
    "addonFeatures": [
        "DnsService",
        "RepairManager"
    ],        
    "certificateCommonNames": {
        "commonNames": [
        {
            "certificateCommonName": "[parameters('certificateCommonName')]",
            "certificateIssuerThumbprint": ""
        }
        ],
        "x509StoreName": "[parameters('certificateStoreValue')]"
    },
    ...

【问题讨论】:

标签: visual-studio certificate azure-service-fabric


【解决方案1】:

我找到了 Visual Studio 的解决方案。我需要添加/更新PublishProfiles/Cloud.xml 文件。我将ServerCertThumbprint 替换为ServerCommonName,然后将证书CN 用于新属性和现有FindValue 属性。此外,我将FindType 的属性更改为FindBySubjectName。我现在能够成功连接我的应用程序并将其发布到集群。

<ClusterConnectionParameters 
    ConnectionEndpoint="sf-commonnametest-scus.southcentralus.cloudapp.azure.com:19000"
    X509Credential="true"
    ServerCommonName="sfrpe2eetest.southcentralus.cloudapp.azure.com"
    FindType="FindBySubjectName"
    FindValue="sfrpe2eetest.southcentralus.cloudapp.azure.com"
    StoreLocation="CurrentUser"
    StoreName="My" />

【讨论】:

    猜你喜欢
    • 2017-06-04
    • 2020-12-26
    • 2017-04-07
    • 1970-01-01
    • 2019-06-05
    • 2017-01-30
    • 2017-01-05
    • 2016-11-24
    • 1970-01-01
    相关资源
    最近更新 更多