Visual studio 如何让Visual Studio将应用程序发布到由证书公用名而不是指纹保护的服务结构群集?
我按照文档中的步骤将现有的ARM模板转换为使用commonname设置而不是指纹。部署成功,在典型的证书选择弹出窗口之后,我能够使用浏览器连接到Service Fabric Explorer。接下来,我尝试像以前一样将应用程序部署到集群。尽管我可以在VS公共服务结构应用程序对话框中看到集群连接端点URI,但VS无法连接到集群。之前,我会得到一个允许VS访问本地证书的提示。有人知道如何让VS使用证书公用名将应用程序部署到service fabric群集设置中吗 以上MS链接摘录:Visual studio 如何让Visual Studio将应用程序发布到由证书公用名而不是指纹保护的服务结构群集?,visual-studio,certificate,azure-service-fabric,Visual Studio,Certificate,Azure Service Fabric,我按照文档中的步骤将现有的ARM模板转换为使用commonname设置而不是指纹。部署成功,在典型的证书选择弹出窗口之后,我能够使用浏览器连接到Service Fabric Explorer。接下来,我尝试像以前一样将应用程序部署到集群。尽管我可以在VS公共服务结构应用程序对话框中看到集群连接端点URI,但VS无法连接到集群。之前,我会得到一个允许VS访问本地证书的提示。有人知道如何让VS使用证书公用名将应用程序部署到service fabric群集设置中吗 以上MS链接摘录: "virtual
"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"
}
},
及
我找到了VisualStudio的解决方案。我需要添加/更新
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" />
这里正在进行保护:
<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" />