question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set-VstsTaskVariable Writes Secret Variable Value to Log

See original GitHub issue

When using the following code in my custom task, the value of the Secret variable is written to the logs. Set-VstsTaskVariable -Name test_pass -Value <password> -Secret;

The output is as follows: ##vso[task.setvariable variable=test_pass;issecret=True]<password>

I would expect the output to be something like this ##vso[task.setvariable variable=test_pass;issecret=True]

This might only happen when using the documentation instructions for Testing and Debugging, I have not tested on our live production system. (https://github.com/Microsoft/vsts-task-lib/blob/master/powershell/Docs/TestingAndDebugging.md)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jtpettycommented, Jan 2, 2020

@damccorm - This was fixed in https://github.com/microsoft/azure-pipelines-agent/pull/2659 of the agent and will be included in 2.164.0

0reactions
damccormcommented, Jan 2, 2020

This is probably related to https://github.com/microsoft/azure-pipelines-task-lib/issues/589 which I believe @jtpetty was taking a look at. Because of our escaping rules, this variable is getting modified as of #543. @jtpetty we should probably react on the agent side and just be a little more aggressive in what we mask.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set secret variables - Azure Pipelines | Microsoft Learn
setvariable logging command to set variables in PowerShell and Bash scripts. This is the least secure way to work with secret variables but...
Read more >
Secret variables sometimes leaking in logs. #9633 - GitHub
Variables marked as secrets are not always obfuscated in log output. Based on my experimentation it has to do with the presence of...
Read more >
How to set secret environment variable with logging ...
As the logging command usage mentions: When issecret is set to true, the value of the variable will be saved as secret and...
Read more >
How to expose secret variables in Azure DevOps - WinOpsDBA
First, we will create two variables as part of our release pipeline. Variable name, Variable value. plain_text_variable, plaintextvariable.
Read more >
When you REALLY want to see your Azure DevOps Secret ...
Helpfully kept out of the logs by Azure DevOps hence the *** so what to do? I thought - I know what I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found