azure-swa-gotchas

azure-swa-gotchas is a skill for Claude Code, Codex from fabioc-aloha/Alex_Skill_Mall. It costs 17 tokens per session (1,514 once invoked), scanned A, original, MIT.

A troubleshooting guide to Azure Static Web Apps, Microsoft's hosting service for web frontends with optional APIs and authentication. It focuses on edge cases involving routes, deployments, linked backends, and Functions.

In plain words
What is it for?
Use it to diagnose Static Web Apps route configuration, backend linking, GitHub Actions deployments, authentication, and embedded Azure Functions.
Why use it?
It helps explain silent deployment failures, authentication redirect loops, and APIs that return missing or unexpected results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to diagnose Static Web Apps route configuration, backend linking, GitHub Actions deployments, authentication, and embedded Azure Functions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fabioc-aloha/Alex_Skill_Mall --skill azure-swa-gotchas
Clone the repo
git clone --depth 1 https://github.com/fabioc-aloha/Alex_Skill_Mall

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for azure-swa-gotchas

README.md
[![agentmods](https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas/github.svg)](https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas)
Your own site
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for azure-swa-gotchas

Your own site · 80×15
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-swa-gotchas.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.01514
Opus 5 $0.00009 $0.00757
Sonnet 5 $0.00003 $0.00303
Haiku 4.5 $0.00002 $0.00151

Measured 8d ago against content hash 93a6dc6980da, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

azure-swa-gotchas scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url, { signal: controller.signal });
plugins/cloud-infrastructure/azure-swa-gotchas/skills/azure-swa-gotchas/SKILL.md · 265 lines

How it starts

The opening of the file, as written. The whole thing — 265 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Azure Static Web Apps Gotchas

Time saved: 2-4 hours per issue


The Problem

Azure Static Web Apps is powerful but has numerous edge cases that cause silent failures or confusing behavior. The documentation covers the happy path; these are the unhappy paths.

Why This Is Hard to Find

  • Each gotcha is documented somewhere, but scattered across GitHub issues, Stack Overflow, and blog posts
  • Error messages often don't indicate the root cause
  • Some behaviors are undocumented "features"
  • The combination of SWA + Functions + Auth creates emergent failure modes

The Gotchas

1. Auth Route Ordering Matters

Symptom: Login callbacks return 401 → infinite redirect loop

Cause: /.auth/* routes must be explicitly allowed for anonymous BEFORE any /* wildcard with authenticated.

Solution:

{
  "routes": [
    { "route": "/.auth/*", "allowedRoles": ["anonymous"] },
    { "route": "/*", "allowedRoles": ["authenticated"] }
  ]
}

Time saved: 1-2 hours


2. Embedded API Overrides Linked Backend

Symptom: Your linked Function App returns 404, but embedded Functions work

Cause: If the workflow has api_location:, SWA deploys embedded Functions which override any linked backend.

Solution: Remove api_location from workflow to route to the linked Function App.

# Remove this line:
# api_location: "api"

Time saved: 1-2 hours


3. SWA CLI v2.0.8 Silently Fails

Symptom: CLI reports success but nothing uploads

Cause: Known bug in v2.0.8

Solution: Use GitHub Actions (Azure/static-web-apps-deploy@v1) instead.

- uses: Azure/static-web-apps-deploy@v1
  with:
    azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
    repo_token: ${{ secrets.GITHUB_TOKEN }}
    action: "upload"
    app_location: "/"
    output_location: "dist"

Time saved: 30-60 min


4. Custom Domain Redirect URIs Required

Symptom: Auth works on default hostname, fails on custom domain

Read the full file on GitHub · 265 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 265 lines · 17 tokens per session scan A 93a6dc6980da

Subscribe to this mod's changes

azure-swa-gotchas is a skill published in the GitHub repository fabioc-aloha/Alex_Skill_Mall (4 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 1,514 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.