Every so often something weird might happen when a user is navigating a PowerApps Portal (which includes Dynamics 365 Portals). They might get an error message or strange pop-up, some examples;
This type of error does not really indicate what the issue could be.
Another example is an error could appear on a particular entity form page when you submit a record, again, the message is very cryptic and doesn’t really indicate what the issue is.
A quick and easy way to diagnose a particular PowerApps Portal error is to see if you can replicate the error in a corresponding model-driven PowerApp. For example, the above error was triggered when creating a support case on the Dynamics 365 Customer Self-Service Portal.
Attempting to create a case in Dynamics 365 CE Customer Service model-driven app, using the same data parameters also gives me an error that provides more detail which in fact, would resolve the problem.
Some errors cannot be replicated on a model-driven app so we need to take our diagnostic approach a bit deeper.
Following the guidelines from Microsoft Docs ( https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/view-portal-error-log) one of the first steps would be to Disable custom errors from the Portals Action screen.
The Portal Administration current is accessible via the legacy Dynamics 365 Admin Center. This would apply to both Dynamics 365 and CDS based PowerApps Portals. I assume that this administration experience will be updated in upcoming release waves.
From the Power Platform Administration Center (https://admin.powerplatform.microsoft.com) Choose the Dynamics 365 Admin center from the left hand menu. This will launch the legacy Admin Center. Then choose “Applications” from the tabs and you should be able to locate your PowerApps Portal in the listed Applications. Click on “Manage” to bring up the Portal Admin Page. Finally choose “Portal Actions” to bring up the screen below. Click the “Disable custom errors” to turn off the “user friendly” error messages.
When you attempt to cause the error to occur again, you may now encounter the “yellow screen of death” which may or may not provide some extra information about the particular error you are facing. Note that this could potentially show some sensitive information, so ideally you would only turn on this feature for resolving technical issues, and then return it to custom errors after the issue has been resolve.
If you are still in a position where you need more information to resolve a particular issue, the next step before contacting Microsoft support is to enable Diagnostic Logging for the Portal. This will create detailed error logs for issues encountered on the Portal. The Microsoft Docs site does not go into great detail on how to setup the Azure storage for diagnostic logs, hopefully these steps will make the process clearer.
Setting Up Azure Storage for Diagnostic Logs
You will need to have an active Azure subscription to store the portal error logs.
The error logs will be stored in Blob storage so you will need to configure an Azure storage account. Login to your Azure Portal and create a new Storage Account resource. (You can use an existing Storage Account).
For the most part, you can leave the defaults. I created a dedicated Azure resource group for the portal logging. You ideally will want to configure this storage to be in the same data center as your PowerApps Portals configuration.
Once you setup the parameters the process will verify everything is correct.
After a few moments (usually just a few minutes) your storage account configuration should be complete.
If this is a new storage account, there should be no assets listed.
Under the Settings section, click on the Access keys and copy one of the Connection Strings.
Enable Portal Diagnostic Logging
Navigate back to the Portal Admin page (see above on how to access). This time, choose “Enable diagnostic logging”
Paste in the connection string from your Azure storage account. Choose the retention period (how long you want to keep logs). You eventually will want these logs to be purged to maintain space.
After a few seconds, you should get a message that the diagnostics have been enabled.
If you navigate back to the Azure Portal, you should see that a new Azure Blob container called “telemetry-logs” has been added.
Now go back to the PowerApps Portal and re-create the issue.
Going back to the Azure portal, you should now see some diagnostic logs generated. You can view these using the Azure storage viewer or downloading the CSV file directly.
Viewing the logs, you should now have much more detailed information regarding the issue and then take the next steps to resolve.
Encountering issues on PowerApps Portals does not alway mean an automatic support ticket to Microsoft. There are tools available to allow an administrator to gather key information and hopefully be able to resolve issue quickly.
Error message and YSOD images from Microsoft Docs.
Nick Doelman is a Microsoft Business Applications MVP and appreciates clear, consise and informative error messages.