我正在使用VSTS RM将位部署到我的dev / int / prod环境。
在dev中部署完成之后,在继续执行int之前,我想添加一个验证步骤。验证步骤基本上是对需要证书身份验证的服务的REST API调用。
从我的机器上,我能够正确验证,因为我已在我的机器上安装了证书。
我如何在VSTS RM中实现这一目标?
答案 0 :(得分:1)
尝试使用此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
答案 1 :(得分:0)
如果您使用的是托管代理,则无法安装证书,因此您需要使用私有代理来安装证书。