Diagnosing Errors in PowerApps Portals

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;

Portal Error

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.

Error on Entity Form

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.

Corresponding error in Model Driven App

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.

Portal Administration

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.

Portal Actions

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.

Yellow Screen of Death

Diagnostic Logging

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.

Azure Portal

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).

Create 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.

Creating Storage Account

Once you setup the parameters the process will verify everything is correct.

Azure Storage Verification

After a few moments (usually just a few minutes) your storage account configuration should be complete.

Azure Storage Complete

If this is a new storage account, there should be no assets listed.

Empty Storage

Under the Settings section, click on the Access keys and copy one of the Connection Strings.

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”

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.

Enter in Azure Storage Account Connection String

After a few seconds, you should get a message that the diagnostics have been enabled.

Enabled

If you navigate back to the Azure Portal, you should see that a new Azure Blob container called “telemetry-logs” has been added.

telemtry-logs

Now go back to the PowerApps Portal and re-create the issue.

recreate 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.

Telemetry-Logs with data

Viewing the logs, you should now have much more detailed information regarding the issue and then take the next steps to resolve.

View Diagnostic Information

Summary

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.

Cover Photo by Sarah Kilian on Unsplash

Nick Doelman is a Microsoft Business Applications MVP and appreciates clear, consise and informative error messages.

3 thoughts on “Diagnosing Errors in PowerApps Portals

  1. Nick,

    I disabled custom errors for my portal but did not get the YSOD. thoughts?

    I am getting the “unknown” error message with a error # GUID when I create a case that has an attachment.

    An unknown failure has occurred. Error ID # [deff941e-6202-479f-8c34-51f8a519b9fc

    Creating cases with attachments works on my DEV portal. when I migrated the portal to the TEST portal these errors occur. i also imported the solution form DEV to TEST of course

    I am pursuing an Azure Storage Account (have to go thru channels 😦 ) to enalbe diagnostics.

    any thoughts or advice would be welcome. I am dead in the water on this.

    Like

    1. The first thing I would check is if I could create a case with an attachment directly in your D365 TEST. Sometimes there is a plug-in/process on the Dataverse side that is causing issues that water down to the portal, and the error msgs on the D365 are a bit more readable. For the attachments, are you using any kind of attachment extractor add-on or plug-in that saves the file elsewhere (SharePoint, etc?) Once you are able to enable the diagnostic logs to Azure storage, you should have much better clarity into what the problem is. I would suggest you open a support ticket, but I suspect they would ask you to enable diagnostic logging as well. Hope some of these tips help. Cheers, Nick

      Like

Leave a comment