Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to set environment variable on ubuntu for nodejs pr app

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)

Problem courtesy of: Poul K. Sørensen

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.

Solution courtesy of: JasonM

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How to set environment variable on ubuntu for nodejs pr app

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×