DaiKeung
DaiKeung

Reputation: 1167

Can variables in Azure Pipelines be used in NodeJS code?

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.

Upvotes: 6

Views: 4388

Answers (1)

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41595

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

var buildID = process.env.BUILD_BUILDID

Upvotes: 1

Related Questions