While I was configuring a new Power Portal for a new project, I suddently got a critical error that completely stopped the web site working. The error message was “Server Error in ‘/’ Application.”. This article describes how I managed to find out what was the issue and fix problem.
The Power Portals have a great feature to diagnose issues logging traces in an Azure blog storage account. The screenshots below show you where to find this option in the Power Apps Portals Admin Center:
You just need to take the connection string from your Azure Storage Account and use it in this diagnostic section.
Once you have configured this part, you will be able to see the logs in the Azure portal:
That CSV file can be opened just making a double click on it. Have a look at the different entries to get familiar with the format. In my case, I was looking for those with “error” level. Checking the message column, I could quickly see the actual problem:
My portal was actually trying to connect to an old Dynamics 365 environment that didn’t exist. I created this instance at the beggining but it was not deployed properly. So I decided to create a new instance with a different name and the new portal. I still don’t understand why the portal tried to use the old failed instance.
So, in order to fix the problem, the only thing I had to do was to update the Dynamics 365 URL configuration in the Power Apps Portals admin center:
Once the URL was updated, the portal started working again 🙂