Power BI and D365 CE Connectivity – part 1

It’s been long time and I was looking for writing something about Power BI and Dynamics 365 CE connectivity. In my earlier posts we have seen connectivity between Power BI and Microsoft Navision using content packs. Its high time to discuss about the Dynamics 365 CE and Power BI.

There is a very basic way of connecting to Dynamics 365 CE from Get Data  functionality where I can select the D365 online and directly select the entity to which to connect to. However practically it may not be useful to connect to single entities at a time and create entire data model from scratch.

As D365 CE technical associates or even functional associates, we are very comfortable with fetchxml and “Advanced Find”. Hence we it would be easy for us to create required views in D365 to get specific data from CRM entities and the use those in Power BI for reporting or dashboards. Sounds interesting hmm 🙂  So lets see how to achieve that.

Again XrmToolBox comes to help us, one of the favorite tool as CRM consultants! We just need to install Power Query Builder plugin  as shown in below snippet

Power Query BUilder
Power Query (M) Builder

We can just search with word “Power” and get this plugin. We have to install this plugin and open this plugin connected with the target D365 CRM organisation.

Once this plugin is connected with this target CRM organisation,  open the plugin and click on Load entities as shown in below snippet

Load Entities
Load Entities

It would list all the entities in that CRM instance and we can search required entity  as shown in below snippet.

Load Entities 2
Search option

Let us search opportunity entity here and look at the views for this entity

Opportunity Entity
Search Opportunity and look at views

Let us select the All Opportunities view  for learning purpose. We can actually create complex views based on our requirements to the extent of CRM out of box capabilities.

Opportunity view
All Opportunities view

As soon as we select the view, the below section showing the list of fields would be refreshed and fields selected in the view would be shown in  right bottom section. We can still go ahead and add /remove fields as required using the buttons ==> or <==. Now lets generate the fecthxml for this so click on  Update fetchxml button.

updatefetchxml
Update Fecthxml

We will get list of fields in the fetchxml as shown below

fetchxmlconfig
Fetchxml config

Let us check the checkbox Add record URL to get the record url of the record so that if user wants to navigate to the particular record, this url can be used .Add record URL

Once we are firm that this data we want to use in Power BI, click on generate fetchxml button.

generatefetchxml
Generate Fetchxml

We can get complete fetchxml which can be used in Power BI

fetchxml query

How to use this fetchxml in Power BI and how to actually connect to CRM from Power BI, let us see in my next post.

Happy analyzing CRM data in Power BI 🙂

Continue reading “Power BI and D365 CE Connectivity – part 1”

Understanding D365 CE solution Deployment – Package Deployer

In the previous post, we saw how to create a package containing multiple solutions and configuration data. Let us see how to deploy this package using package deployer tool.

What is package deployer? As CRM technical, we all have used plugin registration tool. Similarly Microsoft provides a tool for package deployment, is called Package Deployer. Before we deploy the package using the package deployer, make sure that it is done in test environment and after verification only should be used for production site.

As we created the package in previous post our package is ready in the Project’s bin folder, inside the debug folder as shown in below snippets.

Project’s folder

Project Folder

Inside Project’s folder, there would be bin folderProject Folderbin

Inside bin folder, there would be debug folder

Project Folderdebug

Inside the debug folder, we can see the PkgFolder and the dll of our package. These two are important items used for deployment. The PkgFolder would consist of the content folder, solutions and data file and import.config file. If you remember, in previous posts, we have selected the Copy always option for these files, hence this folder is copied in the bin folder, when we build the project.

Project Folderdllandfolder

Let us copy these two items ( PkgFolder and project dll file) to some folder, let us say LearningPkgDeployment is the folder name

To obtain the package deployer tool, we have to visit the below site and download the nuget.exe

https://www.nuget.org/downloads

both files

Click on the Download Package Link as shown in below snippet.downlad deployer

Once downloaded the package deployer installable, if it is saved in the folder D, then go to the d folder in command prompt and install this using below command

d:\nuget install Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf -Version [VERSION] -O d:\PD

This will install the package deployer tool to our machine. Once installed , we can use it the same way we use the plugin registration tool. Let us go to the folder which will look like below snippet and copy the above created package dll and Pkgfolder to this folder.

deployer

After copying the two items, double click the package deployer application. It will as for credentials to connect to CRM organisation as we do for plugin registration tool. Just follow the subsequent instructions as the application progresses and we can get our package deployed to target organisation.

As we run the application and deploy the package, we can also do the same using command line. Difference is only after the coping the dll file and pkgfolder to the package deployer root folder, we can go to the command line and run below command

packagedeployer.exe

Hope with all these series of posts regarding deployment, you are able to understand the deployment process in dynamics 365 CE. I know one important topic is still to be explained which is deployment using Power shell scripts, which I will explain in later posts.

Keep reading and keep deploying 🙂

Thank you so much for reading my posts.

Continue reading “Understanding D365 CE solution Deployment – Package Deployer”