【Azure Fabric Service】Service Fabric 托管群集通过 Connect-ServiceFabricCluster 连接时候报错 CertificatedNotMatched

简介: 【Azure Fabric Service】Service Fabric 托管群集通过 Connect-ServiceFabricCluster 连接时候报错 CertificatedNotMatched

问题描述

Service Fabric 托管群集, 使用Key Vault中证书,把证书导入到本地安装后,使用该证书的 Thumbprint 作为指令 Connect-ServiceFabricCluster  的 ServerCertThumbprint 和FindValue 的值。结果连接失败,错误消息为:

Connect-ServiceFabricCluster FABRIC_E_SERVER_AUTHENTICATION_FAILED: CertificateNotMatched

 

 

问题解答

根据错误消息来看,就是使用的证书不对导致的。 而根据错误提示 FABRIC_E_SERVER_AUTHENTICATION_FAILED,  判断是 Connect-ServiceFabricCluster  中 ServerCertThumbprint 值错误。因为在自建的Service Fabric集群环境中, ServerCertThumbprint 和 FindValue (ClientCertThumbprint) 使用的同样的证书,所以他们值一样。

而Service Fabric 托管群集则不一样,Server Cert Thumbprint 需要通过 Get-AzResource 在集群的资源属性中获取。 托管集群将自动管理证书,并且在证书过期前的90天内自动更新。

 

1) 使用以下命令来查询群集资源,以获取群集证书指纹 ServerCertThumbprint  

$serverThumbprint = (Get-AzResource -ResourceId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/managedclusters/mysfcluster)

.Properties.clusterCertificateThumbprints

2) 获取到 serverThumbprint后,使用下面的命令就可以连接到Service Fabric托管集群

##服务端证书指纹
$serverThumbprint = (Get-AzResource -ResourceId 'SF Resource ID' ).Properties.clusterCertificateThumbprints 
##客户端证书指纹
$clientThumbprint= "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
$connectionEndpoint = "<your sf name>.chinaeast2.cloudapp.chinacloudapi.cn:19000"
##连接到SF托管集群
Connect-ServiceFabricCluster -ConnectionEndpoint $connectionEndpoint -KeepAliveIntervalInSec 10 `
      -X509Credential `
      -ServerCertThumbprint $serverThumbprint  `
      -FindType FindByThumbprint `
      -FindValue $clientThumbprint `
      -StoreLocation CurrentUser `
      -StoreName My

引用文档: https://learn.microsoft.com/zh-cn/azure/service-fabric/how-to-managed-cluster-connect#using-the-service-fabric-powershell-module

3) 连接成功!

 

 

 

参考资料

连接到 Service Fabric 托管群集 : https://learn.microsoft.com/zh-cn/azure/service-fabric/how-to-managed-cluster-connect#using-the-service-fabric-powershell-module

Cluster certificate management and 90 day autorotation : https://learn.microsoft.com/en-us/azure/service-fabric/overview-managed-cluster#service-fabric-managed-cluster-advantages

 

相关文章
|
24天前
|
数据安全/隐私保护
【Azure Service Fabric】关于Service Fabric的相关问题
【Azure Service Fabric】关于Service Fabric的相关问题
|
24天前
|
安全 数据可视化 数据安全/隐私保护
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
|
24天前
【Azure Fabric Service】Service Fabric部署失败问题 Provisioning of VM extension ConfigureVM has timed out.
【Azure Fabric Service】Service Fabric部署失败问题 Provisioning of VM extension ConfigureVM has timed out.
|
24天前
|
安全 网络安全
【Service Fabric】Service Fabric删不掉的问题
【Service Fabric】Service Fabric删不掉的问题
|
24天前
【Azure Fabric Service】怎样关闭 Azure Service Fabric?
【Azure Fabric Service】怎样关闭 Azure Service Fabric?
|
11月前
|
开发框架 .NET 区块链
Hyperledger fabric部署链码(五)初始化与链码升级
fabric部署chaincode-go(智能合约)系列之五
159 0
|
11月前
|
测试技术 Go 区块链
Hyperledger fabric 测试环境部署
Hyperledger fabric 测试环境部署及相关问题解答
207 3
Hyperledger fabric 测试环境部署
|
11月前
|
JavaScript 测试技术 Go
Hyperledger fabric部署链码(一)打包链码
fabric部署chaincode-go(智能合约)系列之一
187 0
|
11月前
|
存储 JSON 安全
Hyperledger fabric智能合约编写(一)
本篇文章主要对链码编写的主要思路和部分API进行梳理。
146 1
|
11月前
|
区块链
Hyperledger fabric部署链码(二)安装链码到fabric
fabric部署chaincode-go(智能合约)系列之二
107 1