Thursday, January 19, 2017

Power BI and Microsoft Dynamics 365 one year later

It has been a year since I last wrote a blog post about Combining Microsoft Dynamics Online and Power BI – so it is time for a little update since a lot of great new features have been released in the last couple of months which are also interesting for Dynamics CRM.
The CRM Online 2016 spring release introduced the release of specific content packs for Dynamics CRM Online  – the Dynamics CRM Online Sales Manager and Service Manager content packs include a number of predefined key metrics and key charts and can be used as inspiration to build your own reports. Recently Microsoft also made the PBIX file (Power BI Designer files) available for download so that you can now also include your own custom entities and adapt these content packs to your specific needs – see Use Power BI with Microsoft Dynamics 365 for the links.
Another interesting update was the release of support for R in June 2016 – see R for the masses with Power BI.  To get started with R in Power BI – you can download the Power BI sample with correlation plot in R which uses the rrplot package. Power BI Desktop does not include, deploy or install the R engine. I installed RStudio, the sample Power BI project uses the corrplot package, so you will first need to install this package using the R console prompt in RStudio.

Definitely check out the Create Power BI visuals using R guide (Don’t forget to take at the current limitations in R at the end of the post) and Getting started with R Visuals in Power BI to get started – afterwards you definitely need to take a look at the Welcome to the R script showcase Power BI Gallery to see some interesting examples that you can use.

Listed below is an example of how you can use decision trees in Power BI with R to visualize the probability of something you want to estimate, based on historical data – the sample project uses data about the survival statistics of passengers of the Titanic. The decision tree classifier automatically finds the important decision criteria (or features) to consider which can help you can in making decisions. Decision trees are a form of multiple variable (or multiple effect) analyses. An example of a multiple variable analysis is a probability of sale or likelihood to respond to a marketing campaign as a result of the combined effects of multiple input variables, factors or dimensions.

In July 2016, Power BI Embedded also reached general availability – Power BI embedded allows ISVs to provide the richness of Power BI to customers within their specific multi-tenant applications. This can for example be an Azure hosted web application in which an ISV wants to embed fully, interactive reports built using Power BI. For more information check out Your data. Your visualizations. Your way – with Power BI – which explains the difference between Power BI Embedded and standard Power BI – as well as What is Microsoft Power BI Embedded? Power BI also allows you to embed Power BI tiles in Dynamics 365 dashboards – see Display Power BI visualizations in Dynamics 365 dashboards or  Add or Edit Power BI visualizations on your dashboard for some walkthroughs.

Another important change is the endpoint that you need to use when connecting Power BI directly to Dynamics CRM 365 – from Dynamics CRM version 8.1 onwards (so also for Dynamics 365) you should use the OData endpoint URL and not the OrganizationService SOAP service even though the dialog still shows it as an example – the documentation Use Power BI with Microsoft Dynamics 365 (Technet) has already been updated for this change.

To get an overview of what has been released and what is under development around Power BI for Dynamics 365  - you can also take a look at the roadmap for the updates which have been recently released or which are under development -


Wednesday, January 11, 2017

Organization Insights for Dynamics 365

This new Organization Insights solution provides you with a number of interesting insights and metrics about your CRM instance (aka organization) such as entities which are being used, the storage used by different tables, user activity, system job activity, plugin statistics and API call statistics.  It currently is available as a preview feature in the December 2016 update can be installed separately from the AppSource . This solution provides more detailed information than the Organization Insights dashboard which is included by default in a Dynamics 365 December 2016 Update instance.

One of the new interesting dashboards which is part of this soltuion is the storage dashboard which provides information about the storage used by your tenant and the different CRM instances (or organizations). This dashboard displays total storage and storage per tenant, a breakdown of the top 10 largest tables by size and row count in the current instance and information about common tables  - tables which contain records which can be linked to different types of records such as attachments, audit logs (auditbase) and asyncoperationbase (this table tracks your asynchronous processing job execution (system jobs, workflows, plug-ins, etc). 

A Dynamics 365 Plan 1 application subscription includes by default 10 GB database storage and additional storage is added at a rate of 5GB for every 20 full users – storage is accrued but there is a technical limit of 5TB (For more details see the Dynamics 365 Licensing Guide). It also is possible to purchase additional storage at a price per GB/month.  For those of you who are still using Dynamics CRM Online licenses, will have 5 GB standard storage and 2.5 GB extra per 20 professional users (capped at 50 GB - for more details see the Dynamics CRM Online Licensing Guide)

So it is important to analyze and clear space in Dynamics 365 as outlined in this post – which also suggests a free Dynamics CRM Online  & Dynamics 365 storage space analyzer solution that you can install.


Sunday, January 08, 2017

Using Azure Service Bus and Dynamics 365

You can connect CRM Online (Dynamics 365) with Azure Service Bus by coupling the CRM event execution pipeline to the Microsoft Azure Service Bus. This connection lets the data that has been processed as part of the current CRM operation to be posted to the bus. From here, other line of business applications can consume these messages from Service Bus instead of directly talking with CRM. This is a commonly used hybrid integration scenario.

As of CRM Online Update 1 (Spring release – see KB 2925359 Microsoft Dynamics CRM Online releases for an overview of the different release) – the recommended way of integrating Dynamics CRM Online and Azure Service Bus is using Shared Access Signature authentication.This blog post still uses ACS(Access Control Service) authentication – in a next post I will outline the differences when using SAS (Shared Access Signature) authentication.

Dynamics CRM Online is by default pre-configured for Microsoft Azure integration. You will however still need to proceed with the following steps:
  1. Make sure that you have the Microsoft Azure PowerShell module installed – if you have multiple subscriptions linked to your login – check out  Quick tip – using Azure PowerShell with multiple subscriptions
  2. Create a Service Bus Namespace as outlined in Walkthrough: Configure Microsoft Azure ACS for integration with Dynamics CRM ( )
  3. Add extra configuration settings on Azure Service Bus :
    1. Create a service identity (issuer)
    2. Create a rule group and rules
    3. Configure the scope
  4. These settings can be configured in two different ways
    1. Follow the steps outlined in
    2. Use the plugin registration tool to add the extra required configuration using the (Save & Configure ACS) screen when you register a new endpoint. I will use this option since this is the simplest from a developer perspective – before you can use this screen make sure that you perform the next two steps. First you will need to download the certificate from Dynamics CRM Online – it can be found underneath Settings>Customizations>Developer resources screen
      Next you will need to open Azure Portal (I will be using the classic portal since Azure Service Bus management is still in preview on the new portal) and select the connection information from the Azure Service Bus namespace that you created in the first step. Copy the default key. 
You have now completed all the preparation, so now you can proceed with the configuration within CRM. You will need to create a service endpoint configuration in CRM to allow it to talk to Azure Service Bus. A endpoint is a commonly used term in enterprise integration patterns – (See Introduction to messaging endpoints -  for more details). Endpoints in CRM are used to connect CRM to a messaging system so that it can send and receive messages. As already mentioned, CRM provides standard functionality to integrate with Azure Service Bus as a messaging system.

In this example we are going to integrate CRM with a persistent queue and we are going to leverage the built-in Azure plugin in Dynamics CRM. Open the plugin registration tool and select Register New Service EndPoint.

You should see the screen below for registering a new service endpoint – if you get another screen you are most likely using a newer version of the CRM SDK – and you switch to the CRM 2015 SDK or the first build of the CRM 2016 SDK (December 2015 release). 

Before Dynamics CRM Online can post on the queue you will need to create the queue which was specified in the path “jopx/demo”. You can write code for this or you can simply use a tool such Service Bus Explorer - to create the queue (or you can create the queue from within the Azure Management Portal)
Click on Save & Configure ACS to add the necessary configuration data as outlined before. Here you will need to enter the following information:
  • Fill in the management key that you copied over from the Azure Service Bus connection information
  • Select the certificate file that you downloaded from your CRM Online instance
  • Fill in the issuer name – (This information is also copied over from the Developer resources screen in Dynamics CRM)
When you click Configure ACS – information will be logged on the same screen make sure that you don’t get any errors.

Finally, you will need to define for which CRM entity you want to couple the event execution pipeline to the Microsoft Azure Service Bus. The native CRM Azure-aware plugin allows you to post the data that is being processed as part of the current CRM operation to the queue. It does this by transferring the information in the form of a serializable RemoteExecutionContext object. Registering the Azure-aware plugin is the same as registering any plugin for CRM. Use the plug-in registration tool and right-click on the service endpoint that you just created, then select Register New step to select the “Create” message and the “Contact” entity.

To test it out you simply create a new contact record and you should see that a new entry appears in the CRM System Jobs. After creating a new contact you should have an entry in the CRM System Jobs:  Settings > System Jobs,  indicating that the asynchronous plugin posting the create to Azure has been executed. You can also see the message posted on the queue in the Azure Portal.

Monday, January 02, 2017

Dynamics 365 monthly reading list 12/31/2016

Happy new year to all of you Dynamics 365 geeks and welcome to a new edition of the Dynamics 365 monthly
Previous reading lists: