An Azure service that provides streamlined full-stack web app development.
Hi @Lionel Lapidos ,
Thank you for the detailed investigation and for sharing the resolution.
The HTTP 500 errors from the Azure Static Web App (SWA) BYO backend were caused by three combined infrastructure issues:
NAT Gateway had no Public IP
The Function App was using VNet integration with a NAT Gateway, but the NAT Gateway had no Public IP assigned. This blocked all outbound internet traffic, causing Easy Auth token validation to silently fail before the function code executed, resulting in 0 invocations and SWA 500 errors.
Recommendation: Assigned a Standard Public IP to the NAT Gateway to restore outbound connectivity.
Database IP Not Whitelisted
After outbound connectivity was restored, function executions failed due to:
YAML
MongoServerSelectionError:
The NAT Gateway’s Public IP was not added to MongoDB Atlas IP Access List.
Recommendation: Whitelisted the NAT Gateway Public IP in MongoDB Atlas.
Function App Linked to Wrong SWA
The Function App backend was linked to a test SWA instance instead of production. Since a Function App can only be linked to one SWA at a time, the production SWA had no backend and returned SWA-level errors.
Recommendation : Unlinked from test SWA and relinked to the correct production SWA.
Kindly let us know if the above comment helps or you need further assistance on this issue.
Could you Please click "Accept the answer” and Yes, this can be beneficial to other community members.
If you have any other questions, let me know in the "comments" and I would be happy to help you