An error occurred on your Dynamics 365 portal? Did you know it was possible to record relevant details and consult them? This way, more information on the causes of the error will give you clues as to how to correct it. But how can one do it, you may ask? By connecting Dynamics 365 to Azure for error logging!
Before we start, make sure that:
- your organization runs the Microsoft Dynamics 365 Portal;
- it runs online (and not as an on-premise software);
- you have an MSDN account with a $150–$200 credit on Microsoft Azure.
Ready to fix bugs more efficiently? In only twenty minutes, you will make a simple adjustment that will make your work easier. In this article, you will learn how to log future bug details on your platform. So, here are 3 simple steps to connect Dynamics 365 to the Azure cloud computing platform and log error information.
- Configure Microsoft Azure (so it can get the error messages)
- Configure Microsoft Dynamics 365 (so the platform saves error details)
- Test it out (to see the bugs)
Why log portal errors?
For example, you are currently developing your organization’s client space. While doing so, a bug occurs.
After having configured these settings, you will be able to fix the issue more easily. Simply knowing the date and time of the bug will allow you to find out exactly what created the anomaly.
1. Open MSDN (Visual Studio) to configure error logging
For this first step, go to https://my.visualstudio.com and log in! Then follow these instructions:
a. Activate your free Azure credits
In order to benefit from a new service on your cloud computing platform, click the button to activate your free credits.
b. Open the Azure portal
Now, go to https://portal.azure.com/#home.
c. Create a resource
Among the available options, select “Create a resource.”
d. Type “storage account”
In the search bar, type “storage account.”
e. Click on “Create”
It’s time to create your Microsoft Azure storage account.
Why create an Azure account? Actually, by opening an account on the cloud platform, you get:
- a unique name space for your data, accessible from anywhere;
- a durable and secure storage account for your data.
f. Fill in the required fields
Enter the required information in the fields marked with an asterisk:
- Resource group
- Storage account name
Then click on “Next” and keep clicking that button to accept default options. Finally, click on “Create.”
g. Open the resource
Once the deployment is completed, open the resource and copy the access key.
2. Configure error logging on the Power Platform admin center
Now that the storage account is ready, you can configure the portal to log errors. To do so, first open the Microsoft Power Platform admin center by clicking here: https://admin.powerplatform.microsoft.com/.
a. Select your environment
First, select your environment, then click on the Portals link.
b. Select “Manage”
Then go to the section that will allow you to manage your portals.
c. Update the diagnostic logging configuration
Under Portal Actions, update the diagnostic logging configuration.
d. Paste the access key
You can now paste the access key you copied on step 1.g in the connection string:
3. Test your new error logging configuration
It’s testing time! Now that you’ve configured Azure so it can receive error messages and Dynamics 365 so it can save them, you’re ready to see it in action.
a. Generate a bug!
In your portal, carry out the action that usually produces an error. Then, go back to your storage account and click “Open” in Explorer.
b. Open the blob container and the telemetry logs
Now open the “blob container” section to reach “telemetry–logs.”
c. Find the latest file in the results
Then, keep double-clicking until you find the relevant date and time, and download the latest file.
d. Inspect the lines
You can now open the file in a text editor (e.g. Notepad++). Go to the end of the file and inspect the lines there.
For example, this is what it could look like:
All errors are now being logged!
From now on, all errors will be recorded, and you will be able to consult them at any time. Fixing bugs will be a piece of cake!
This article is an initiative of our expert Jean-François Fortin.
To go further…
Here’s another useful debugging tool:
- Fiddler (to intercept web requests)
Want to learn more?