Skip to content

Use environment variable to control default verbosity#580

Open
austindonnelly wants to merge 6 commits into
microsoft:masterfrom
austindonnelly:austind/default-verbosity
Open

Use environment variable to control default verbosity#580
austindonnelly wants to merge 6 commits into
microsoft:masterfrom
austindonnelly:austind/default-verbosity

Conversation

@austindonnelly

@austindonnelly austindonnelly commented Sep 30, 2025

Copy link
Copy Markdown

This PR implements suggestion #579

  • Add new env var ARTIFACTS_CREDENTIALPROVIDER_VERBOSITY_DEFAULT
  • If present, it sets the default for the -Verbosity command line option.
  • If absent, default is LogLevel.Information - no change to previous behaviour.
  • Command line flag dominates environment variable - no change to previous behaviour.

These changes make it much easier to debug uses of the Credential Provider from (eg) pip where it is almost impossible to control the -V option on the command line.

@austindonnelly austindonnelly changed the title Feat: use environment variable to control default verbosity Use environment variable to control default verbosity Sep 30, 2025
Comment thread CredentialProvider.Microsoft/Util/EnvUtil.cs Outdated
@embetten

embetten commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

@cobya / @austindonnelly -

Can we think about moving the environment variable to the artifacts-keyring layer instead? My main concern is avoiding multiple places where verbosity can be set and all other protocols use cli inputs to specify it. Also, since PowerArgs is quite slow and we're aiming to remove it in the future, we'd like to reduce our dependency on it wherever possible.

@austindonnelly

Copy link
Copy Markdown
Author

@cobya / @austindonnelly -

Can we think about moving the environment variable to the artifacts-keyring layer instead? My main concern is avoiding multiple places where verbosity can be set and all other protocols use cli inputs to specify it. Also, since PowerArgs is quite slow and we're aiming to remove it in the future, we'd like to reduce our dependency on it wherever possible.

I did originally think this (that the verbosity control should be in artifacts-keyring). The problem is that although this would work for pip, not all python package managers use artifacts-keyring. For example, uv is written in Rust, and directly invokes the credential provider binary.

So that's what led me to putting this control in at the bottom of the stack. Regardless of how the credential provider is invoked, this provides debug capability.

@embetten

embetten commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@austindonnelly

Copy link
Copy Markdown
Author

@embetten @cobya Please consider this PR for merging, to improve debuggability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants