I'm running a React application hosted on Azure Static Web Apps, and I've been encountering an issue with an Azure Function that handles long-running processes. The function operates correctly in the background and doesn't seem to have any problems, but my frontend is timing out after a certain period. I'm seeing a CORS error message that states: 'Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource' along with a 502 status code. CORS settings are configured to allow requests from my frontend, and the timeouts only occur with longer requests. I'd like to know if anyone else has faced this issue and how it could potentially be fixed.
1 Answer
It sounds like you're hitting a timeout limit set by the app gateway, which is usually around 240 seconds. Check out the Azure documentation on API request timeouts—it could give you some insights on this issue. You might need to rethink your approach if long-running requests are essential for your application.
Wait, what? That's a pretty unusual limitation. I've worked with a few other providers and haven't run into such a strict timeout on the frontend before. I'm definitely going to look into the webjobs mentioned in that doc you shared; hopefully it won't be too much of a headache!