-
Notifications
You must be signed in to change notification settings - Fork 37
Guide: Debugging a Static Web App with VS Code
Note: The debugging features referenced in this wiki page are available starting in v0.9.0 of the extension.
This page covers how to setup locally debugging a Static Web App using Visual Studio Code and the Azure Static Web Apps CLI. This enables setting and hitting breakpoints in both your static web app and your Functions API.
-
Azure Static Web Apps extension for VS Code - View on Marketplace
-
Azure Static Web Apps CLI 0.8.0 or greater - View on GitHub
npm install -g @azure/static-web-apps-cli@latest
- Azure Functions Core Tools (required to debug a Static Web App with an API locally) - View on GitHub
npm i -g azure-functions-core-tools@3 --unsafe-perm true
If debugging doesn't work using the dynamic configuration, you can easily provide your own Azure Static Web Apps CLI configuration using a swa-cli.config.json
file.
Make sure both your context
and apiLocation
properties in your SWA CLI configuration are URLs to your frontend app development server, and if you have an API, the apiLocation
property should be the URL where your Functions app is served which by default is http://localhost:7071
.
{
"configurations": {
"app": {
"context": "http://localhost:3000",
"run": "npm start",
"apiLocation": "http://localhost:7071"
}
}
}