Can variables in Azure Pipelines be used in NodeJS code?

Viewed 2760

Can variables in Azure Pipelines (Build/Release) be used in NodeJS code?

If not, can variables set in WebApp be used in NodeJS code as well?

I set variable TESTING & TESTING2 in both Pipelines' Builds and Release and below environment setting in .yaml file:

spec:
  containers:
  - name: devops
      env:
      - name: TESTING
        value: $(TESTING)

Then just tried to print in NodeJS:

process.env.TESTING --> $(TESTING)

process.env.TESTING2 --> undefined

This is not work for me.

1 Answers

Yes, you can use Azure Pipelines variables like every environment variables in NodeJS:

var buildID = process.env.BUILD_BUILDID
Related