Azure Static Web Apps configuration file
Documentation: https://learn.microsoft.com/en-us/azure/static-web-apps/configuration
| Type | object |
|---|---|
| File match |
staticwebapp.config.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/azure-static-web-apps-configuration-file/latest.json |
| Source | https://www.schemastore.org/staticwebapp.config.json |
Validate with Lintel
npx @lintel/lintel check
Documentation: https://aka.ms/swa/config-schema
Properties
JSON schema
Route definitions to modify routing behavior
[
{
"route": "/example",
"rewrite": "/example.html"
}
]
Custom error pages or redirects
Custom mime types configuration
{}
Default headers to set on all responses
2 nested properties
7 nested properties
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
3 nested properties
The name of the claim from which we should read user details
Route to API function for assigning roles. For example, "/api/GetRoles". See https://aka.ms/swa-roles-function
Networking configuration
1 nested properties
Restrict access to one or more IPv4 ranges. Supports CIDR notation (e.g., "192.168.100.14/24")
Forwarding gateway configuration
2 nested properties
The value of X-Forwarded-Host to allow to be used when generating redirect URLs
HTTP header name/value pairs that are required for access
Platform configuration
1 nested properties
Language runtime for the managed functions API
Trailing slash configuration
Definitions
Request route pattern to match. May contain valid wildcards. See documentation: https://aka.ms/swa/config-schema
Request method(s) to match
Roles that are allowed to access this route. If not empty, only role(s) listed are authorized to access the route. Roles are only used for authorization; they are not used to evaluate whether the route matches the request.
Override any matching global headers
Redirect to a relative or absolute path, or an external URI. Default status code is 302, override with 301.
Status code override
A path to rewrite the request route to
7 nested properties
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
4 nested properties
The name of the claim from which we should read user details
3 nested properties
The name of the claim from which we should read user details
Route to API function for assigning roles. For example, "/api/GetRoles". See https://aka.ms/swa-roles-function