Azure SWA giving HTTP 500 Internal Server Error

Benjamin Hubert 20 Reputation points
2025-11-12T08:17:23.5466667+00:00

This morning one of our Azure SWA started giving us internal server errors.

This is on the main environment, all the preview environments on the same SWA still work.

We did not do any deployments this morning prior to this happening.

We have tried re-deploying, we have tried splitting all traffic to the preview site, but none of those worked, we still get internal server error when going to our custom domain.

Please help get this online again.

Here's the JSON cfg of the SWA that's failing:

{
    "apiVersion": "2024-11-01",
    "id": "/subscriptions/<my tenant>/resourceGroups/<my resource group>/providers/Microsoft.Web/staticSites/<my SWA>",
    "name": "<swa name>",
    "type": "microsoft.web/staticsites",
    "sku": {
        "name": "Standard",
        "tier": "Standard"
    },
    "location": "westeurope",
    "properties": {
        "defaultHostname": "<swa host name>",
        "repositoryUrl": null,
        "branch": null,
        "customDomains": [
            "<my custom domain>"
        ],
        "stableInboundIP": "51.124.12.35",
        "privateEndpointConnections": [],
        "stagingEnvironmentPolicy": "Enabled",
        "allowConfigFileUpdates": true,
        "contentDistributionEndpoint": "https://content-am2.infrastructure.1.azurestaticapps.net",
        "keyVaultReferenceIdentity": "SystemAssigned",
        "userProvidedFunctionApps": null,
        "linkedBackends": [],
        "provider": "DevOps",
        "enterpriseGradeCdnStatus": "Disabled",
        "publicNetworkAccess": null,
        "databaseConnections": [],
        "trafficSplitting": {
            "environmentDistribution": {
                "default": 100
            }
        },
        "targetResourceGroupResourceId": null,
        "trialExpirationTimeUtc": null,
        "prettyNameStatus": null,
        "prettyName": null,
        "prettyNameHostname": null,
        "backendRegion": {
            "regionName": null,
            "status": null
        },
        "stagingEnvironmentRegion": null,
        "deploymentAuthPolicy": "DeploymentToken",
        "federatedIdentityTenantId": null,
        "federatedIdentityClientId": null,
        "federatedIdentitySubscriptionId": null,
        "deploymentStorageAccountResourceId": null,
        "deploymentStorageAccountReferenceIdentity": null,
        "networkConfigurations": null
    }
}

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-12T08:17:43.2933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To troubleshoot the HTTP 500 Internal Server Error you're experiencing with your Azure Static Web App (SWA), consider the following steps:

    1. Check Application Insights: If you have Application Insights configured, check the logs for any runtime errors or exceptions that might provide more context about the internal server error. You can access this by navigating to the Application Insights instance associated with your SWA in the Azure portal.
    2. Review Deployment Logs: Since you mentioned that you redeployed the application, review the deployment logs in your GitHub repository under the Actions tab. Look for any errors that occurred during the build and deployment process.
    3. Validate Configuration Settings: Ensure that your configuration settings in the SWA JSON are correct. Pay special attention to the api_location and app_location settings, as incorrect paths can lead to errors.
    4. Check for Recent Changes: Although you mentioned no deployments were made, verify if there were any changes in the environment or dependencies that could affect the application. Sometimes, external services or APIs that your app relies on may have changed.
    5. Inspect Custom Domain Configuration: Ensure that your custom domain is correctly configured and pointing to the right SWA. If there are issues with DNS or SSL certificates, it could lead to internal server errors.
    6. Traffic Splitting: Since you mentioned splitting traffic to the preview site, double-check that the traffic splitting configuration is set correctly and that the preview site is functioning as expected.

    If these steps do not resolve the issue, consider reaching out to Azure support for further assistance.


    References:

    0 comments No comments

  2. Shree Hima Bindu Maganti 6,120 Reputation points Microsoft External Staff Moderator
    2025-12-04T17:20:58.9533333+00:00

    Hi @Benjamin Hubert
    Thanks for your Conformation. The issue with your SWA production environment has now been resolved. After investigation, the problem was not related to your deployment pipeline or code the production environment was in an unhealthy state on the platform side. The backend instance hosting that environment was refreshed and brought back into a healthy state, which cleared the HTTP 500 errors.

    Your SWA is now responding normally, and you should be able to deploy and access it without issues. We will continue to monitor to ensure stability, but no further action is required on your end.

    Please let me know if you see anything unexpected or if you need additional assistance.
    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.