Hi @Andrew Sabin
Thank you for providing the additional details.
Based on the behavior and logs shared, I would not** recommend changing the SQL connection string or simply increasing the connection timeout as the first resolution. The strongest reproducible symptom is that, after the application remains idle for approximately 20–30 minutes, the next operation results in an HTTP **404 and the application navigates to the NotFound page. Refreshing the application then restores functionality.
The connection string screenshot also shows an Azure SQL endpoint (*.database.windows.net). This format is valid for Azure SQL Database connectivity and, by itself, doesn't indicate a connection-string problem. Microsoft also documents Azure SQL database connectivity for Azure Static Web Apps scenarios.
Recommended checks and resolution
1.** Identify the request returning **404
When the problem occurs, open Browser** Developer Tools (F12) > **Network, reproduce the failure, and locate the request returning 404.
Check:
- Request URL
- Request method
- Response body
- Whether the request is for an application route or the backend API
This is important because an HTTP 404 means that the requested route/resource wasn't found. If the failing request is the backend API, troubleshoot the API endpoint and its server-side logs rather than the Azure SQL connection itself.
2.** Review Azure Static Web Apps **routing
If the request is an application route, review staticwebapp.config.json, particularly the route and fallback configuration.
Azure Static Web Apps uses this file to control routing, authentication/authorization rules, fallback routes, and HTTP response overrides.
For a Blazor application that relies on client-side routing, ensure that the required fallback behavior is configured so that valid application routes aren't incorrectly handled as missing resources.
3.** Check the backend/API **path
Because the database access occurs through an API/backend, verify whether the API endpoint itself still works when the issue occurs.
If the failed request is an API call:
- Check the API/backend logs for the same timestamp.
- Verify whether authentication/session state has expired.
- Check whether the endpoint returned the 404 directly.
- Verify that the route requested by the Blazor component matches the API route.
- Check the underlying database operation only if the request successfully reaches the backend.
This separates a routing/API issue from an actual database connectivity failure.
4.** Don't rely on prerender=true as the **fix
Changing the component to prerender=true isn't expected to resolve this type of idle-time 404 on its own.
In Blazor, prerendering determines how interactive components are initially rendered before they become interactive. Microsoft also notes that prerendering is enabled by default for interactive components.
Given that enabling prerendering didn't change the reported behavior, I wouldn't focus further troubleshooting on that setting.
Conclusion
Based on the currently available evidence, the recommended troubleshooting path is:
Blazor** client → failing HTTP request → Static Web Apps route/API → backend → **database
rather than assuming that the SQL connection string is causing the problem.
The earlier SQL timeout should still be correlated with backend logs if it occurs again, but the repeatable 404** → NotFound → refresh restores **functionality behavior should be investigated at the application/API routing layer first.
If anyone encounters the same issue, capturing the failed request from F12** > **Network is particularly useful because it immediately establishes which layer is returning the 404.
Microsoft official documentation
If the answer is helpful, please do click "Accept the answer” and Yes, this can be beneficial to other community members.