How to add secret variable as task environment variable in VSTS

前端 未结 3 1211
甜味超标
甜味超标 2021-01-12 00:46

This documentation states that secret variables are

Not decrypted into environment variables. So scripts and programs run by your build steps are not

3条回答
  •  盖世英雄少女心
    2021-01-12 01:22

    Set Environment Variable

    Use a Command Line task, like this:



    target_environment_variable now contains the value of secret_variable.

    Verify

    Add a subsequent Command Line task that writes all environment variables to a disk file, like this: (note: in the Arguments text box, write to a folder that both you and build agent can access):




    Queue the build definition, then view the file containing the environment variables:

提交回复
热议问题