Unable to view server error logs in Azure SWA using Application Insights

ChokSheak Lau 0 Reputation points
2024-10-24T04:52:36.7533333+00:00

I'm using a NextJS 14 web app on Azure SWA, and am getting the error below:

An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.

I found multiple online articles explaining how to get the error logs, but nothing works. Also this app works fine locally and in AWS Amplify with no errors at all with almost the identical setup. This error has something to do with trying to access the "Azure Database for PostgreSQL - Flexible Server" instance which is also working fine on localhost. But it is failing on Azure SWA.

  1. How do I get the error logs??? Seems like a super basic thing but turns out to be impossibly hard to do in Azure, which is quite surprising.
  2. What would the problem possibly be?

Thanks in advance for your kind help here. I am stuck now!

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
957 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.