This assumes that you have a Git repo created with create-nuxt-app and are ready to test your site on the web. I won’t go into the steps as to do this, but there’s a lovely guide to getting started on Nuxt. This also assumes that you know how to set up an App Service instance on the Azure console or via CLI.
- Test run launching locally by running
npm run devand checking out http://localhost:3000 - If that works, end the process by pressing
Ctrl+Cback in the terminal. - Create an initial commit for your Nuxt repo.
- Congrats! You’re done here.
After you’ve created your app instance, on you app service page:
- Go to your Configuration. Here, you’ll set up some environment variables that are important for Nuxt to operate.
- Under Application Settings, set these variables:
HOSTto0.0.0.0NODE_ENVtoproductionPORTto3000.
- Click save.
- Go to General settings.
- Here, you’re looking for the Startup Command setting. You’ll want to enter
node_modules/nuxt/bin/nuxt.js startin the box. This is incredibly important as the App Service won’t start Nuxt it doesn’t recognize the default npm command. - Click save again and deploy as you wish. My preference is to do it via the Github and Azure Pipeline. The YAML on this Gist should replace the Pipeline YAML if you choose to do so.