To deploy for the first time
- Open a new folder in VScode
- Open a terminal in VScode
- In the terminal type git clone
- Wait for repo to be cloned
- The rest of the deploy instructions follow MSlearn istructions from https://learn.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-vscode
- In the terminal, ensure you're in the myExpressApp directory, then start Visual Studio Code with the following command: code .
- In Visual Studio Code, in the Activity Bar, select the Azure logo.
- In the App Service explorer, select Sign in to Azure... and follow the instructions.
- In Visual Studio Code, you should see your Azure email address in the Status Bar and your subscription in the AZURE APP SERVICE explorer.
- Right-click on App Services and select Create new Web App. A Linux container is used by default.
- Type a globally unique name for your web app.
- In Select a runtime stack, select the Node.js version you want. (Generally an LTS version).
- In Select a pricing tier, select Free (F1) and wait for the resources to be created in Azure.
- In the popup Always deploy the workspace "myExpressApp" to ", select Yes.
- While Visual Studio Code creates the Azure resources and deploys the code, it shows progress notifications.
- Once deployment completes, select Browse Website in the notification popup. The browser should display the Express default page.
To redeploy
- In the terminal, ensure you're in the myExpressApp directory, then start Visual Studio Code with the following command: code .
- In Visual Studio Code, in the Activity Bar, select the Azure logo.
- In the App Service explorer, select Sign in to Azure... and follow the instructions.
- In Visual Studio Code, you should see your Azure email address in the Status Bar and your subscription in the AZURE APP SERVICE explorer.
- Right-click on App Services and select Redeploy
To run locally
- Move into your app folder cd <my_app>
- enter npm start in the terminal
- open localhost:3000 to view the app