Skip to content

IsRunningOnAzurePipelines doesn't work for Ubuntu #3149

Answered by pascalberger
matt40k asked this question in Q&A
Discussion options

You must be logged in to vote

If you're running on hosted pool you need to call IsRunningOnAzurePipelinesHosted not IsRunningOnAzurePipelinesHosted.

IsRunningOnAzurePipelines is defined as:

public bool IsRunningOnAzurePipelines
    => !string.IsNullOrWhiteSpace(_environment.GetEnvironmentVariable("TF_BUILD")) && !IsHostedAgent;

IsRunningOnAzurePipelinesHosted is defined as:

public bool IsRunningOnAzurePipelinesHosted
    => !string.IsNullOrWhiteSpace(_environment.GetEnvironmentVariable("TF_BUILD")) && IsHostedAgent;

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pascalberger
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3148 on February 16, 2021 06:45.