Azure Web App can reach container app in VNet with curl -v command but frontend can not with fetch
I have an application set up in Azure consisting of two components. A frontend which is deployed as a Azure Web App using a docker image and a Azure Container App as a backend which is a python application with FastAPI to read/write data from/to a Azure SQL Database.
Both the frontend and backend is placed in the same VNet with only the frontend being accessable through internet. I've set up a private endpoint for the container app such that the frontend should be able to communicate with the backend. Through Kudu app service, I can retrieve the data as expected with curl -v <endpoint>. However, the frontend (nextjs app), gets "Failed to load resource: net::ERR_CONNECTION_CLOSED" and "Failed to load resource: net::ERR_CONNECTION_ABORTED" error when trying to retrieve the same data. I've used both axios and fetch, with the same result.
CORS should not be the problem(?), as I've set it to "*" (for the purpose of troubleshooting). The apps are placed in subnets with appropriate sizes (/24 for frontend, /23 for private endpoint), and the Web App has disabled the outbound internet traffic. All recommended troubleshooting steps I've found implies that it should be working.
The application works as expected when it is deployed without using a VNet.
Any ideas?
Thanks