Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement]: Enable Injection of Secret Environment Variables into VSTest Task in Classic Release Pipelines #20811

Open
mikejohnstonPremierinc opened this issue Jan 28, 2025 · 0 comments

Comments

@mikejohnstonPremierinc
Copy link

mikejohnstonPremierinc commented Jan 28, 2025

Task name

VsTest

Describe your feature request here

Description

In Classic release pipelines, variables can be linked via variable groups and accessed within the VSTestV2 task. These variables are accessed when the Classic release pipeline is linked to Azure automated Test Plans via Azure Test Plan Association. To access them, one adds Environment.GetEnvironmentVariable to his C# automation code, then runs a Test Plan on Azure via automation Test Plan Association.

Problem

If these variables are marked as secret, they are not injected into the environment during task execution, unless they are explicitly defined within the VSTestV2 task.

YAML-based pipelines allow a user to explicitly define secret variables by adding the env input to the VSTestV2 YAML.

YAML from Classic release pipelines is read-only. You can only modify the settings of VSTestV2 using the pre-built fields of the task's UI. This UI currently does not have an environment variables field.

As a result, secret variables are unable to be passed into VSTestV2 using the Classic release pipelines. Attempts to access them using Environment.GetEnvironmentVariable in C# return null.

This discrepancy limits secure configuration management and reduces task flexibility when sensitive information is required for tests.

Proposed Solution

Update the VSTestV2 task to be able to securely inject secret variables defined in linked variable groups into the task environment. Most likely, by adding the field Environment Variables to the settings UI.

Ensure these variables are available to the process without logging or exposing them in task outputs. Maintain secure handling in line with existing Azure DevOps secret management practices.

Alternatives

Write custom scripts to manually inject secrets, which is not secure and contradicts best practices.

Convert Classic release pipelines to YAML-based pipelines. But Classic release pipelines are not compatible with Test Plan Associations, so this is not a valid alternative.

Benefits

Parity between Classic release pipelines and YAML pipelines.

Enhanced security and flexibility for testing configurations requiring sensitive information.

Improved usability for teams managing secure variable groups in Classic pipelines.

@mikejohnstonPremierinc mikejohnstonPremierinc changed the title [enhancement]: Enable Injection of Secret Environment Variables into VSTestV2 Task in Azure Classic Release Pipelines [enhancement]: Enable Injection of Secret Environment Variables into VSTestV2 Task in Classic Release Pipelines Jan 28, 2025
@mikejohnstonPremierinc mikejohnstonPremierinc changed the title [enhancement]: Enable Injection of Secret Environment Variables into VSTestV2 Task in Classic Release Pipelines [enhancement]: Enable Injection of Secret Environment Variables into VSTest Task in Classic Release Pipelines Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant