How to set environment variable on ubuntu for nodejs pr app
Problem
Is it possible to set Environment Variables per nodejs app?
The azure module will read the Environment variables AZURE_SERVICEBUS_NAMESPACE and AZURE_SERVICEBUS_ACCESS_KEY for information required to connect to your Windows Azure Service Bus. If these environment variables are not set, you must specify the account information when calling createServiceBusService.
I would like to set different namespaces/key on a per app lvl instead of global?
(i am hosting it in a ubuntu vm)
Solution
Not sure if that is possible. But there is something you can do.
In your application just set those environment variables based on others:
process.env.AZURE_SERVICEBUS_NAMESPACE = process.env._AZURE_SERVICEBUS_NAMESPACE
process.env.AZURE_SERVICEBUS_ACCESS_KEY = process.env._AZURE_SERVICEBUS_ACCESS_KEY
Its a little more verbose but I am not sure if you can set dynamic environment variables.
Discussion
View additional discussion.