Deploy the Website
In this step, you deploy your Node.js website using VS Code and the Azure App Service extension. This tutorial uses the most basic deployment model where your app is zipped and deployed to an Azure Web App on Linux.
Deploy using Azure App Service
In the AZURE APP SERVICE explorer, click the blue up arrow icon to deploy your app to Azure.
Tip: You can also deploy from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) by typing 'deploy to web app' and running the Azure App Service: Deploy to Web App command.
Choose Create New Web App.
Type a globally unique name for your Web App and press Enter. Valid characters for an app name are 'a-z', '0-9', and '-'.
Choose a location in a region near you or near other services you may need to access.
Choose your Node.js version, LTS is recommended.
The notification channel shows the Azure resources that are being created for your app.
- Choose the directory that you currently have open,
Click Yes when prompted to updated your configuration to run
npm install on the target server. Your app is then deployed.
Once the deployment starts, you're prompted to updated your workspace so that all subsequent deploys automatically target the same App Service Web App. Choose Yes to ensure your changes are deployed to the correct app.
Tip: Be sure that your application is listening on the port provided by the PORT environment variable:
Browse the website
Once the deployment completes, click Browse Website in the prompt to view your freshly deployed website.
Are you seeing the error "You do not have permission to view this directory or page."? If so, the application probably failed to start correctly. Head to the next step and view the log output to find and fix the error. If you aren't able to fix it, contact us by clicking the I ran into an issue button below. We're happy to help!
Updating the website
You can deploy changes to this app by using the same process and choosing the existing app rather than creating a new one.