Reputation: 1167
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
Reputation: 41595
Yes, you can use Azure Pipelines variables like every environment variables in NodeJS:
var buildID = process.env.BUILD_BUILDID
Upvotes: 1