question

averroes avatar image
0 Votes"
averroes asked ryanchill commented

How to configure a staging NODE_ENV environment in Node JS for SSR app like Nuxt JS?

I've set the NODE_ENV to staging in App Service for my deployment slot. It doesn't seem to pick up the App Setting for the environment as the output is always production. How can I set up App Service for a staging environment so that the infrastructure relates specifically to it?

azure-webapps-content-deployment
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ryanchill commented

Hi @averroes,

Try using WEBSITE_NODE_DEFAULT_VERSION environment variable instead. See https://docs.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-windows#set-nodejs-version for more details.

EDIT: My apologies, WEBSITE_NODE_DEFAULT_VERSION is for setting node runtime your app will be using. All you need to do is add NODE_ENV as an app setting and make sure that Deployment slot setting is checked.

130294-image.png

130305-image.png



image.png (122.5 KiB)
image.png (78.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ryanchill Sorry, I’ve tried this approach and don’t see how node version has anything to do with an environment

0 Votes 0 ·

Apologies for my misunderstanding @averroes please see my updated answer.

0 Votes 0 ·