This example demonstrates how to debug a node app deployed to an app service. This tutorial is intended to demonstrate a useful developer tool utilizing Azure App Services and enable developers to do more and remove roadblocks with existing tools.
There is 1 folder in this example
- infrastructure - Containing the Bicep scripts to setup the example as needed
Note: This procedure will restart the webapp several times
- Visual Studio Code locally installed with the Azure App Service Extension
- Azure Resource Group with Contributor Rights
- Azure CLI
- Bicep
- Upgrade the bicep version
az bicep upgrade
- Upgrade Azure CLI
az upgrade
- Create a resource group name. This name will be reused in the next several steps.
- Download this repository.
- Open a Powershell command line to this repo folder.
- On the command line login to Azure
az login
- Set the subscription, this step is needed if you have multiple subscriptions associated with your account
az account set --subscription [Subscription ID]
- Create a resource group if needed
az group create --location centralus --name [Resource Group Name]
- Deploy the bicep Infrastructure
az deployment group create --resource-group [Resource Group Name] --template-file .\infrastructure\webapp.bicep
At the end of this deployment a webapp and a B1 plan will be created in the Central US region. When browsing to the URL for the webapp you will get a default page showing the text "Hello World".
Wait, where is the code?
The code will be downloaded to Visual Studio Code from the WebApp. No need to host the code locally.
- Open the Azure Tool and Login if needed
- Browse the the webapp
- Right click on the webapp and select start remote debugging
- When Prompted select enable debugging This will restart the webapp
- On the debug screen you can choose which files to select under the scripts folder
- Set the breakpoint as necessary
- Browse to the URL and hit the breakpoint
- Disconnect from the Debugging session and select to disable debugging. This will restart the webapp
Delete the resource and all contained components