【问题标题】:Creation of WindowsAzure.Management certificate on server side在服务器端创建 WindowsAzure.Management 证书
【发布时间】:2015-08-20 20:55:40
【问题描述】:
  1. Base64 中的证书,通过 Azure PowerShell 中的 Get-AzurePublishSettingsFile 命令获取(Azure 中没有自定义证书/设置/管理证书不添加)
  2. 创建证书:

    Byte[] 证书 = Convert.FromBase64String(AzureData.Base64AzureManagementCertificate);

其中 AzureData.Base64AzureManagementCertificate - 资源文件

X509Cer = new X509Certificate2 (certificate, String.Empty, X509KeyStorageFlags.Exportable);

本地运行项目,一切正常。

发布后,X509Certificate2(...) 出现错误: "系统找不到指定的文件"

我该如何解决这个问题?

【问题讨论】:

  • 您是否在 Azure 网站中运行此代码?
  • 是的,在 Azure 网站一侧
  • 请参阅这篇关于在 Azure 网站中使用证书的博文:azure.microsoft.com/blog/2014/10/27/…。 HTH。
  • 非常感谢,这篇文章很有帮助,但不是一个完整的解决方案,见下文。

标签: c# azure


【解决方案1】:

按照文章做所有事情: https://azure.microsoft.com/blog/2014/10/27/using-certificates-in-azure-websites-applications/

但是(3.从应用程序访问)

我们还必须将证书 .cer 添加到 Azure/Settings/Management Certificates 然后初始化证书:

new X509Certificate2(certificate, "password", X509KeyStorageFlags.MachineKeySet);

在哪里证书 .pfx 文件,密码 - 到 PFX

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-05
    • 2021-10-03
    • 2016-07-18
    • 2011-05-22
    • 2020-02-16
    • 2012-01-16
    相关资源
    最近更新 更多