Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Azure set and expose the `CI` environment variable?

There's a 5 year old Github issue that asks for Azure to set the conventional CI environment variable to true, so that it can be used by scripts relying on this convention.

Is env.CI set today?

like image 732
oligofren Avatar asked Sep 07 '25 17:09

oligofren


1 Answers

As of the date of this question, it appears that Azure DevOps services doesn't define or expose a CI variable.

The TF_BUILD variable will be defined and set to true for scripts running within an Azure Pipeline. This is the equivalent of the CI variable. To be portable, a script could test for either CI or TF_BUILD.

(Azure DevOps was previously known as Team Foundation Server/Services (TFS), hence the TF in TF_BUILD.)

like image 116
Jonathan Dodds Avatar answered Sep 10 '25 07:09

Jonathan Dodds