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

Averroes 41 Reputation points
2021-04-24T20:27:43.397+00:00

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 App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,939 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2021-04-26T16:39:38.443+00:00

    Hi @Averroes ,

    Try using WEBSITE_NODE_DEFAULT_VERSION environment variable instead. See https://learn.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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.