【问题标题】:VSTS IIS Deploy Configure IIS site SSL CertificatesVSTS IIS 部署配置 IIS 站点 SSL 证书
【发布时间】:2018-03-22 12:07:38
【问题描述】:

我正在使用 VSTS 使用 IIS Web App Manage 和 IIS Web App Deploy 任务部署一个 asp.net 网站,但我正在寻找自动安装和配置站点 SSL 证书的方法,以便我在主机上部署站点之前不必手动安装 ssl 证书。

我正在考虑使用以下方法。

1) 在 vs 解决方案中包含 ssl 证书。

2) 将 ssl 证书部署为站点部署并使用 远程 powershell 任务运行“CertMgr”以将证书安装在 localmachines 个人证书存储。

在理想情况下,我希望将 SSL 证书作为部署定义的一部分包含在 VSTS 中,但我看不到此选项?在我走 VS 解决方案路线之前,是否可以配置 VSTS 部署任务以在远程目标计算机上下载和安装 SSL 证书?

【问题讨论】:

    标签: azure-devops devops azure-pipelines


    【解决方案1】:

    没有可以下载和安装证书的内置任务。您可以将其添加到源代码控制或其他服务器(例如 FTP),然后在构建/发布期间下载证书(可以通过 PowerShell 下载文件)。

    之后,您可以通过 PowerShell 任务安装证书:

    $pfxpath = 'pathtoees.pfx'
    $password = 'password'
    
    Add-Type -AssemblyName System.Security
    $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
    $cert.Import($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")
    $store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "MY", CurrentUser
    $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
    $store.Add($cert)
    $store.Close()
    

    相关问题:Visual studio team services deploymen/buildt certificate error

    【讨论】:

    • 嗨,我想这样做,但专门针对 IIS 证书。如何将证书添加到特定于 IIS 的证书存储中,然后为特定的 IIS 站点创建新的 Web 绑定......全部使用 Azure DevOps?
    猜你喜欢
    • 2020-04-09
    • 1970-01-01
    • 2017-10-31
    • 2019-08-29
    • 1970-01-01
    • 1970-01-01
    • 2012-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多