【Azure 微服务】Service Fabric, 使用ARM Template方式来更新SF集群的证书(Renew SF Certificate)

简介: 【Azure 微服务】Service Fabric, 使用ARM Template方式来更新SF集群的证书(Renew SF Certificate)

问题描述

因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)一文中,描述了因为证书过期而导致了SF集群不可用,并且通过命令dd-AzServiceFabricClusterCertificate 或az sf cluster certificate add 来添加证书为辅助证书(secondary cluster certificate) 并通过SF门户页面中的交换主要/辅助证书功能把新上传的证书作与旧证书进行交换。

在本文中,介绍通过ARM Template的修改来实现辅助证书的添加。

 

执行步骤

测试环境为:SF Silver, 5 Nodes

步骤一:在Key Vault中添加新的Certificate,完成后截图如下

步骤二:在SF的resource group这页面中,选择SF和cluster资源,并导出模板(export template), 进入步骤三的Template View页面

步骤三:在Template view,选择Deploy,直接进入第四步的编辑模板页面

步骤四:在Edit模板的页面中,修改如下内容(非常重要

  • 查找第一个Certificate Thumbprint,并增加红框中内容。需要增加Thumbprint的位置共有3

 

 

 

 

 

 

  • 查找certificateStore,并在所有查到的地方增加如下内容(本例中需要修改certificateStore的位置一共有6个)。

 

步骤五:修改完后Save并返回template view,而后勾选底部的checkbox后点击Purchase,进行cluster upgrade

步骤六:在SF Cluster Upgrade的过程中,可以通过SF 观察每一个UD (update domain)的情况。

  • 期间,cluster upgrade的状态会在RollingForwardInProgress,RollingForwardPending间切换。直至RollingForwardCompleted,表示完成。

步骤七:在更新完的Node中,点开Details Tab,可以看到添加证书的指纹信息

步骤八:当所有Upgrade完成后,可以在SF门户上的Security页面上看到新添加的辅助证书信息

步骤九:交换主要/辅助证书(点击证书信息后面三点 ... 进行操作)

注:在此过程中建议采用先添加新的certificate,然后做swap to primary,而不是一开始就直接替换certificate的策略,这样就算这个过程发生些异常,也不会影响当前的cluster及业务的运行。

 

附录:参考Deploy the template to Azure文档,使用命令进行发布模板

文档链接:https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-security-update-certs-azure#deploy-the-template-to-azure

#登录到Azure中
Connect-AzAccount
Select-AzSubscription -SubscriptionId <Subscription ID>
#验证模板是否正确
Test-AzResourceGroupDeployment -ResourceGroupName <Resource Group that your cluster is currently deployed to> -TemplateFile <PathToTemplate>
#部署模板
New-AzResourceGroupDeployment -Name ExampleDeployment -ResourceGroupName <Resource Group that your cluster is currently deployed to> -TemplateFile <PathToTemplate>

 

参考资料

Edit your Resource Manager template:https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-security-update-certs-azure#edit-your-resource-manager-template

 

相关文章
|
数据安全/隐私保护
【Azure Service Fabric】关于Service Fabric的相关问题
【Azure Service Fabric】关于Service Fabric的相关问题
125 0
|
8月前
|
JSON 数据格式
【Azure Fabric Service】演示使用PowerShell命令部署SF应用程序(.NET)
本文详细介绍了在中国区微软云Azure上使用Service Fabrics服务时,通过PowerShell命令发布.NET应用的全过程。由于Visual Studio 2022无法直接发布应用,需借助PowerShell脚本完成部署。文章分三步讲解:首先在Visual Studio 2022中打包应用部署包,其次连接SF集群并上传部署包,最后注册应用类型、创建实例并启动服务。过程中涉及关键参数如服务器证书指纹和服务端证书指纹的获取,并附带图文说明,便于操作。参考官方文档,帮助用户成功部署并运行服务。
287 73
|
JavaScript 前端开发 API
【Azure Developer】use @azure/arm-monitor sdk 遇见 ManagedIdentityCredential authentication failed.(status code 500)
【Azure Developer】use @azure/arm-monitor sdk 遇见 ManagedIdentityCredential authentication failed.(status code 500)
111 1
|
8月前
|
JSON 缓存 数据格式
【Azure Fabric Service】分享使用Visual Studio 2022发布中国区Service Fabric服务应用的办法
本文介绍了在Visual Studio 2022中无法直接创建Service Fabric Cluster服务时的替代方案。通过使用PowerShell命令或修改Cloud.xml文件,可将应用部署到已创建的SF Cluster。具体步骤包括:1) 在Azure门户创建Service Fabric服务并安装客户端证书;2) 获取服务端和客户端证书指纹;3) 修改Cloud.xml中的ClusterConnectionParameters后发布应用。最后附有参考资料以供进一步学习。
150 4
|
存储 网络协议 安全
【Azure 环境】ARM部署模板大于4MB的解决方案及Linked Template遇见存储账号防火墙无法访问
【Azure 环境】ARM部署模板大于4MB的解决方案及Linked Template遇见存储账号防火墙无法访问
169 0
|
9月前
|
存储 网络协议 网络安全
【Azure 环境】部署ARM Linked Template时候 Blob SAS Token不能正常工作
Unable to retrieve url https://<stroage account name>.blob.core.chinacloudapi.cn/arm/azuredeploy.json?sp=r 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'spr' is no
161 1
|
安全 数据可视化 数据安全/隐私保护
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
168 3
【Azure 微服务】新创建的Service Fabric集群,如何从本地机器上连接到Service Fabric Explorer(Service Fabric状态/错误查看工具)呢?
|
Kubernetes Cloud Native 微服务
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
480 1
【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.
128 0

热门文章

最新文章