Service Fabric Error: Failed to ACL folders or certificates required by application. Error:FABRIC_E_CERTIFICATE_NOT_FOUND

Service Fabric Error: Failed to ACL folders or certificates required by application. Error:FABRIC_E_CERTIFICATE_NOT_FOUND

我被这个难住了。我有一个带有一些加密应用程序设置的安全集群。该应用程序在我的本地集群上运行良好,但在部署到云时却运行不正常。

应用程序部署正常,但无法启动并出现以下错误:无法访问应用程序所需的 ACL 文件夹或证书。 Error:FABRIC_E_CERTIFICATE_NOT_FOUND.

我创建了一个自签名证书,将其(使用私钥)导出到 PFX,并将其上传到保管库:

New-SelfSignedCertificate -Type DocumentEncryptionCert -KeyUsage     DataEncipherment -Subject mycert -Provider 'Microsoft Enhanced Cryptographic Provider v1.0'

Invoke-AddCertToKeyVault -SubscriptionId 'xxxxx-bxxxxfb9-xxxx-xxx-xxxxx' -ResourceGroupName 'vault-sec-studio-dev' -Location "Central US" -VaultName 'vault-sec-studio-dev' -CertificateName 'mycert' -Password "myPass" -UseExistingCertificate -ExistingPfxFilePath "C:\temp\Azure\Dev\mycert.pfx"

我通过引用指纹将证书添加到集群安全选项卡:

我更新了 ApplicationManifest.xml:

<Principals>
    <Users>
      <User Name="Service1" AccountType="NetworkService" />
    </Users>
  </Principals>
  <Policies>
    <SecurityAccessPolicies>
      <SecurityAccessPolicy GrantRights="Read" PrincipalRef="Service1" ResourceRef="mycert" ResourceType="Certificate"/>
    </SecurityAccessPolicies>
  </Policies>
  <Certificates>
    <SecretsCertificate X509FindValue="72C57495F3034E072CA6F536EEABE984AA869CBC" X509StoreName="My"   X509FindType="FindByThumbprint" Name="mycert"  />
  </Certificates>

Sevice Fabric Explorer 页面显示升级已安装但未能启动。几个节点处于错误状态:

远程访问 VM 时,我没有看到安装此证书。我看到了用于保护集群的主证书,但没有看到这个管理员证书。

我已尝试在每个虚拟机上手动安装证书,但得到的结果相同。

我在这上面花了很多时间,似乎无处可去,所以我希望有人能在这里给我一些指示。

更新: 我在 VM 的事件日志中看到了这一点。谈到私钥,这让我觉得证书或 pfx 有问题?

Failed to get the Certificate's private key. Thumbprint:72C57495F3034E072CA6F536EEABE984AA869CBC. Error: FABRIC_E_CERTIFICATE_NOT_FOUND

这个问题终于解决了。我不能说我完全理解这一点,但这是我发现的:

  1. 不要使用门户创建 Service Fabric 集群。您需要使用该模板才能配置证书。

  2. 也不需要像我最初那样在安全选项卡上乱搞管理员证书(请参阅原始问题)。那些对此不起作用,或者至少不是我期望的那样。

  3. 您必须编辑 ARM 模板并将以下证书信息添加到每个 VM 上的 "secrets" 数组中:

上面的注释部分已添加并指向证书 URL

"settingCertificateUrlValue":{ "value": "https://vault-my-site.vault.azure.net:443/secrets/studiosecrets/487a94749ee148979cc97a68abe9fd3a" },

集群现在 "green",应用运行正常。