azure-static-web-apps

Create, configure, and deploy Azure Static Web Apps using the SWA CLI.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/lettucebo/Skills --skill azure-static-web-apps-lettucebo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: azure-static-web-apps
Source: https://github.com/lettucebo/Skills/tree/main/skills/azure/azure-static-web-apps
Command: npx skills add https://github.com/lettucebo/Skills --skill azure-static-web-apps-lettucebo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @azure/static-web-apps-cli.

What problem does it solve? Deploying static frontends with serverless APIs to Azure involves juggling CLI configuration, local emulation, runtime settings, and CI/CD pipelines, and small mistakes like manually creating the wrong config file cause confusing failures. ## Core Features & Use Cases - SWA CLI Workflow Guidance: Covers the full swa init, swa start, swa login, and swa deploy lifecycle with correct flag usage and framework auto-detection. - Configuration Management: Distinguishes between swa-cli.config.json (generated by swa init) and staticwebapp.config.json (manually authored runtime config for routes, auth, and API runtime). - Azure Functions API Integration: Shows how to add a Node.js, .NET, or Python API backend and wire it into the local emulator and deployment. - GitHub Actions CI/CD: Provides a ready workflow for build, deploy, and PR preview environments using the Static Web Apps deploy action. - Use Case: You have a React app and want to ship it with a serverless API. The Skill walks you through swa init, local testing at localhost:4280, and production deployment with a deployment token. ## Quick Start Ask the agent to initialize and deploy your static frontend to Azure Static Web Apps using the SWA CLI, starting with swa init and ending with swa deploy to production.

Frequently Asked Questions about azure-static-web-apps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a static site to Azure Static Web Apps?▼

Install the SWA CLI with npm install -D @azure/static-web-apps-cli, run swa init to generate configuration, then swa login and swa deploy --env production. You can pass a deployment token via --deployment-token or the SWA_CLI_DEPLOYMENT_TOKEN environment variable.

How do I run Azure Static Web Apps locally with an API?▼

Run swa start with your build output folder and the --api-location flag pointing to your Azure Functions folder, for example swa start ./dist --api-location ./api. The emulator serves the app at http://localhost:4280 and proxies /api requests to the Functions runtime.

What is the difference between swa-cli.config.json and staticwebapp.config.json?▼

swa-cli.config.json holds CLI settings like app location and build commands and must be created by running swa init, never manually. staticwebapp.config.json defines runtime behavior such as routes, auth, navigation fallback, and API runtime, and can be authored by hand.

Which API runtimes does Azure Static Web Apps support?▼

Supported API runtimes include node:18, node:20, node:22, dotnet:8.0, dotnet-isolated:8.0, python:3.10, and python:3.11. Set the runtime in staticwebapp.config.json under platform.apiRuntime.

Why do I get 404 errors on client-side routes in Static Web Apps?▼

Client-side routes return 404 because the server has no matching file. Add a navigationFallback section to staticwebapp.config.json with rewrite set to /index.html and exclude static asset paths like /images/* and /css/*.

How do I set up GitHub Actions deployment for Static Web Apps?▼

Use the Azure/static-web-apps-deploy@v1 action with your deployment token stored as the AZURE_STATIC_WEB_APPS_API_TOKEN secret. Configure app_location, api_location, and output_location, and the same workflow can close preview environments when pull requests are closed.