7

NodeJS applications on Azure portal are running by default in production environment (process.env.NODE_ENV is production).

Is it possible to change the environment to development? And how?

(If it matters, I configured the application as a Web Site on Azure.)

2
  • Are you asking how to set an environment variable on Windows? Commented Jul 17, 2014 at 13:40
  • 2
    No. I'm asking how to configure azure to run the development environment? Commented Jul 17, 2014 at 14:03

1 Answer 1

14

You can set the NODE_ENV variable under the Website App settings configuration on the portal: http://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/#howtochangeconfig

Additionally, if you are using the Azure CLI (which you can install via npm install azure-cli -g), you can run the following azure site config add NODE_ENV=development assuming your CLI is configured.

This will ask you for the website name then set the config.

Sign up to request clarification or add additional context in comments.

2 Comments

doesn't the app settings in azure add the prefix to it and break how NODE would pick up that setting?
I saw this when I first started this adventure. I just chuckled to myself and said, yea, I bet that works great for a dotnet app. No way in hell that's ever going to work with node since it's Microsoft. A couple weeks later after trying multiple different setups I came back to this. It works like a charm. I just put in an app setting and referenced it in my node app (process.env.*) and it worked like a champ. I hate to do it, but one gold star for microsft. I definitely thought they were just running node in some bastardized fashion with no access to anything you would actually need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.