在 Azure 云服务(外延支持)中使用证书

Key Vault 用于存储与云服务(外延支持)关联的证书。 可通过 Azure 门户PowerShell 创建密钥保管库。 将证书添加到密钥保管库,然后引用服务配置文件中的证书指纹。 还需要启用 Key Vault 来获得适当的权限,以便云服务(外延支持)资源可从 Key Vault 检索存储为机密的证书。

向 Key Vault 上传证书

  1. 登录到 Azure 门户并导航到密钥保管库。 如果未设置 Key Vault,可以选择在此同一窗口中创建一个。

  2. 选择“访问配置”

    Image shows selecting access policies from the key vault blade.

  3. 确保访问配置包括以下属性:

    • 启用对 Azure 虚拟机的访问以进行部署

    Image shows access policies window in the Azure portal.

  4. 选择“证书”

    Image shows selecting the certificates option from the key vault blade policies window in the Azure portal.

  5. 选择“生成/导入”

    Image shows selecting the generate/ import option

  6. 填写完成上传证书所需的信息。 证书需要采用 .PFX 格式。

    Image shows importing window in the Azure portal.

  7. 将证书详细信息添加到服务配置(.cscfg) 文件中的角色。 确保 Azure 门户中证书的指纹与服务配置 (.cscfg) 文件中的指纹相匹配。

    <Certificate name="<your cert name>" thumbprint="<thumbprint in key vault" thumbprintAlgorithm="sha1" /> 
    
  8. 若要通过 ARM 模板进行部署,可导航到 Key Vault 中标记为“机密标识符”的证书来找到 certificateUrl

    Image shows the secret identifier field in the key vault.

后续步骤