Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare Azure environments for new workloads—subscriptions, networking, identity, and landing zones
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/services/static-web-apps/routing.md
1# Static Web Apps - Routing & Authentication23## Route Configuration45Create `staticwebapp.config.json` in the app root:67```json8{9"routes": [10{11"route": "/api/*",12"allowedRoles": ["authenticated"]13}14],15"navigationFallback": {16"rewrite": "/index.html",17"exclude": ["/api/*", "/*.{png,jpg,gif}"]18},19"responseOverrides": {20"404": {21"rewrite": "/404.html"22}23}24}25```2627## Authentication2829### Built-in Providers3031```json32{33"routes": [34{35"route": "/admin/*",36"allowedRoles": ["admin"]37}38],39"auth": {40"identityProviders": {41"azureActiveDirectory": {42"registration": {43"openIdIssuer": "https://login.microsoftonline.com/{tenant-id}",44"clientIdSettingName": "AAD_CLIENT_ID",45"clientSecretSettingName": "AAD_CLIENT_SECRET"46}47}48}49}50}51```5253### Supported Providers5455- Azure Active Directory / Entra ID56- GitHub5758- Custom OpenID Connect5960## Role-Based Access6162```json63{64"routes": [65{ "route": "/admin/*", "allowedRoles": ["admin"] },66{ "route": "/account/*", "allowedRoles": ["authenticated"] },67{ "route": "/*", "allowedRoles": ["anonymous"] }68]69}70```71