I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution.
Please click "Accept" the answer as original posters help the community find answers faster by identifying the correct answer.
Issue :
Intermittent 404 Errors with Azure Static Web App and Application Gateway
Resolution :
- I suggested we check the Application Gateway Access Log
- You informed us that there was a misconfiguration and two IP addresses were added to one hostname in DNS management ,
- Which included the shared API Gateway's IP address.
- When traffic was routed to the production API Gateway, everything worked fine.
- However, when it was directed to the shared API Gateway, we were encountering 404 errors.
- Post correcting this, the issue has been resolved.
Cheers,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.