[英]VSTS import Key Vault Certificate to a file on HostedVS build
How can I import certificates from Key Vault to a folder on HostedVS17?如何将证书从 Key Vault 导入到 HostedVS17 上的文件夹?
Currently, I have a key Vault task that accesses all the certificates.目前,我有一个访问所有证书的密钥保管库任务。 How can I import them to a temp folder for subsequent task scripts to execute?
如何将它们导入临时文件夹以供后续任务脚本执行? I am using HostedVS2017
我正在使用 HostedVS2017
can add two tasks to import certificates from Key Vault into files.可以添加两个任务将证书从 Key Vault 导入文件。 Detail steps as below:
详细步骤如下:
Add a PowerShell task to import certificates into files添加PowerShell 任务以将证书导入文件
Assume there has a certificate with the name cer1
in your key vault, then you can use the powershell script echo $(cer1) > myfile
to import it into the file myfile
.假设您的密钥保管库中有一个名为
cer1
的证书,那么您可以使用 powershell 脚本echo $(cer1) > myfile
将其导入文件myfile
。
Besides, you can use the certificates as variables directly.此外,您可以直接将证书用作变量。 As above example, you can use the variable
$(cer1)
directly.如上例,您可以直接使用变量
$(cer1)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.