To troubleshoot the HTTP 500 Internal Server Error you're experiencing with your Azure Static Web App (SWA), consider the following steps:
- 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.
- 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.
- Validate Configuration Settings: Ensure that your configuration settings in the SWA JSON are correct. Pay special attention to the
api_locationandapp_locationsettings, as incorrect paths can lead to errors. - 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.
- 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.
- 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: