VSTS机密作为环境变量 [英] VSTS secrets as environment variables
本文介绍了VSTS机密作为环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在VSTS构建中,我设置了各种变量(编辑构建->变量"选项卡),有一些设置为秘密(单击锁),有一些则没有.
In the VSTS build, I set various variables (Edit build -> Variables tab), some I set as secret (click the lock), some I don't.
在构建中,我运行命令提示符任务以运行set
-例如向我展示所有环境变量.那些标记为秘密的人不存在.
In the build, I run a command prompt task to run set
-- e.g. show me all the environment variables. Those marked as secret aren't present.
如何将VSTS机密信息放入环境变量中?
How do I get VSTS secrets into environment variables?
推荐答案
秘密变量是:
- 静止时使用2048位RSA密钥加密.
- 未返回给客户端.它们会自动被屏蔽掉 构建或发行版的任何日志输出.
- 未解密为环境变量.因此脚本和程序运行 默认情况下,您的构建步骤未授予访问权限.
- 已解密,可通过您的构建步骤进行访问.所以你可以在它们中使用它们
密码参数,并将其明确传递给脚本或
程序中的程序(例如
$(password)
).
- Encrypted at rest with a 2048-bit RSA key.
- Not returned back to the client. They are automatically masked out of any log output from the build or release.
- Not decrypted into environment variables. So scripts and programs run by your build steps are not given access by default.
- Decrypted for access by your build steps. So you can use them in
password arguments and also pass them explicitly into a script or a
program from your build step (for example as
$(password)
).
因此,安全变量需要作为输入传递到任务中.检查这种情况:如何将秘密变量添加为VSTS中的任务环境变量
So, Secure variables need to be passed in to tasks as inputs. Check this case: How to add secret variable as task environment variable in VSTS
这篇关于VSTS机密作为环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文