Archive for December, 2017

The reply address does not match the configured – Azure ADAL and Dynamics 365

December 27, 2017 Leave a comment

I was building a standalone HTML page which retrieves the Account records from Dynamics 365 and show them in a table.

As a prerequisite, I registered the application in Azure Active Directory’s ‘App registrations’.

OAuth Error - 1

Also configured the Application details in my HTML page

var organizationURI = “https://{orgname}”; //The URL to connect to CRM (online)
var tenant = “{Azure Tenant Name}”; //The name of the Azure AD organization you use
var clientId = “{Application ID}”; //The ApplicationId you got when you registered the application
var pageUrl = “http://localhost”; //The URL of your HTML page in your development environment.

After all the configuration, I was getting below error during the authentication

The reply address “http://…..” does not match the reply address configured for the application.

OAuth Error

Reason and Fix:

  • There must be a ‘Return URL’ configured with your application URL (i.e., HTML url in my case).
  • To configure the ‘Return URL’
    • Connect to ‘Azure Active Directory’ –> App registrations
    • Select your configured Application
    • Under ‘Settings’, click on ‘Reply URLs’
    • Add your application URL (i.e., HTML url in my case)

OAuth Error - 3

  • Rerun the Application and you should be able to connect and get Accounts

OAuth Error - 4

Refer this MSDN article for step by step to connect via ADAL



Categories: Azure, CRM Tags: , , ,

Liquid script to fetch Contact names – Dynamics Portals SaaS

December 26, 2017 Leave a comment

In Dynamics portals (SaaS) to make CRM server calls to retrieve the data we must rely on Liquid Script.

In this article, I am going to retrieve Contacts and loop through to capture Contact ‘Full Name‘ using Liquid Script and display on a Web Template.

Liquid Script - 1

Liquid script to fetch Contacts:

{% fetchxml settings %}
<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false”>
<entity name=”contact”>
<attribute name=”fullname” />
<attribute name=”telephone1″ />
<order attribute=”fullname” descending=”false” />
{% endfetchxml %}
{% assign result = settings.results.entities %}
{% for item in result %}
{% assign Names = {{item.fullname}} | append: ‘ , ‘ | append: {{Names}} %}
{% endfor %}

// Set the Concatenated text to Span so that it can be read in JScript

<span id=”spanContactNames” style=”display:block”>{{Names}}</span>

Complete Web Template Source:

<html lang=”en” xmlns=””&gt;
<meta charset=”utf-8″ />

function onload() {

// Read Contact names from Span
var spanContactNames = document.getElementById(“spanContactNames”);
if (spanContactNames) {

<body onload=”onload()”>
<h1>**Contact Names**</h1>
{% fetchxml settings %}
<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false”>
<entity name=”contact”>
<attribute name=”fullname” />
<attribute name=”telephone1″ />
<order attribute=”fullname” descending=”false” />
{% endfetchxml %}
{% assign result = settings.results.entities %}
{% for item in result %}
{% assign Names = {{item.fullname}} | append: ‘ , ‘ | append: {{Names}} %}
{% endfor %}
<span id=”spanContactNames” style=”display:block”>{{Names}}</span>

Note :

  • ‘Liquid Script’ gets executed during the Web Page render and hence the fetched values will be available on Page ‘onload’ script event.
  • ‘Liquid Script’ will respect the Portal security model (i.e., It fetches the records only if you have access granted by your Web Role)

How to test:

  • Create a new Web Template and paste the content to “Source” field.

Liquid Script - 2

  • Add a Web Link and map your Web Template.


Categories: ADX Tags: ,

Dynamics Portals – How to get the configured Portal’s URL

December 19, 2017 1 comment

There was a question posted in my blog on how to get the configured Portal’s URL as someone else configured the portal.

Below are the steps to get your Portal URL.

From your Dynamics 365 Instance:

  • Connect to your Dynamics 365 instance
  • Navigate to Portals -> Website Bindings
  • Open the record and read the URL from “Site Name” field

Portal - URL 3

From your Dynamics 365 Admin Center:

  • Connect to your “Dynamics 365 Admin Center” (i.e., Login to
  • Select your “Dynamics 365” instance
  • Click on “Applications” tab
  • Select “Portal Add-on” and click “MANAGE” button

Portal - URL 1

  • You would be redirected to “Portal” configuration page
  • Copy the URL

Portal - URL 2

Note:  You can access your Portal configurations page, only if your Admin granted access to your login Account. If you don’t have permission, you would end up getting below error message:

You don’t have permission to perform this action. Contact your global administrator to get owner permission for Application ID


Categories: ADX, CRM Tags: , ,

Move Attachments from CRM to Azure Blob – “Attachment Management” tool

December 17, 2017 3 comments

Recently I was exploring options to move attachments from CRM (i.e., Notes and Email) to Azure Blob storage and came across “Attachment Management” tool from Microsoft Labs.

This tool can be installed as a solution to your Dynamics 365 instance. Detailed steps and usage guide are available here.

In this article I am going to detail the imperative Azure and Dynamics 365 settings which would avoid the connectivity issues you may encounter during my usage.

Pre-requisites to use this solution:

  • Dynamics 365 instance (You can subscribe for 30 days trail)
  • Enable the “Attachment Management” solution from App Source.
  • Microsoft Azure Account (You can subscribe for trail)
    • Note: You can use the same Dynamics Office 365 account to register for Azure trail account. 

Setting up Azure Storage Account:

Make sure your Azure Storage Account settings matches with below

  • Azure “Storage Account” ‘KIND’ must be “BlobStorage”.

Attachment - Azure Storage Account

  • “Storage Account” Containers ‘Public Access Level’ must be “Blob”.

Attachment - Containers

  • “Shared Access Signature” (SAS token)
    • Set the “Start” to Previous Day as the Azure time zone depends the data Center you choose. (For example, your IST date may be 1 day ahead of your ‘Data Center’ date which may make your ‘SAS token’ invalid)
    • Set the “End” to at least a week ahead of today.

Attachment - Shared Access Signature

Settings in Dynamics 365:

  • With the “Attachment Management” solution you will get 3 entities and a ‘Site Map Area’ (i.e., Azure Attachment Storage)
  • Make sure you configure settings only from ‘Azure Attachment Storage’ site map link and not from ‘Advanced Find’

Attachment - Sitemap

  • In “Azure Blob Storage Setup” page, make sure the ‘Storage Account Name’, ‘Container names’ and ‘SAS token’ matches with Azure settings

Attachment - BlobStorageSettings

  • In “NOTES ATTACHMENT SETTING ENTITY” page, pick your entities and provide correct “Container” name or leave that blank.
    • Note: If you have Dynamics Portal solution installed, uncheck the ‘Web Files’ entity, if its selected.

Attachment - NotesAttachment Page

Troubleshooting steps:

  • After you configure all the settings try adding a Note with attachment to the entity you configured.
  • If you don’t see your attachments move to Azure Container, go to ‘System Settings’ and look for “MicrosoftLabs.AttachmentManagement…..” job for exception.

Attachment - System Jobs


Configure CafeX Live Assist on Dynamics Portals

December 15, 2017 Leave a comment

In this article, I am going to detail the steps to configure ‘Live Assist’ on ‘Dynamics Portals’.

Those who are not familiar with CafeX Live Assist, Live Assist for Microsoft Dynamics 365 Powered by CaféX is a fully integrated omnichannel (i.e., across mobile and web) solution. It provides Chat, Co-browse features.

Note: As we are going to configure ‘Live Assist’ on Dynamics Portals, make sure you have enabled Dynamics 365 portal solution on your Dynamics 365 instance.

To start with, enable the ‘Live Assist’ solution on your Dynamics 365 online instance.

Enable ‘Live Assist’ solution in Dynamics 365 instance:

You can start your ‘Live Assist’ free trail from ‘App Source’

Live Assist - Set up

  • Complete the suggested steps which installs the ‘Live Assist’ solution in your Dynamics 365 Instance.
  • Once you followed the steps, give it few minutes and you should see ‘Live Assist for Dynamics 365’ solution with ‘Installed’ status.

Live Assist - Set up 2

  • Open your Dynamics 365 instance and you should see the ‘CafeX’ tool bar.

Live Assist - CRM

Enable ‘Live Assist’ on Dynamics Portal:

In ‘Live Assist’ scenario, your Dynamics Portal acts as Visitor site and Dynamics 365 works as receiver (i.e., Agent) site, which means, Portal users initiate the chat which will be addressed by CRM User.

Below are the 2 steps to configure Chat window on your Dynamics Portals which allows your Portals User to initiate the chat.

  1. Copy the chat widget script from CafeX site:
  • Check your email inbox for Cafex confirmation mail with CafeX website URL.

Live Assist - Set up email

  • Navigate to the URL and click on ‘GET STARTED’ tab
  • Click ‘COPY’ button to copy the chat widget script.

Live Assist Prtl - 22. Configure Portal Web Template:

  • Go to Dynamics 365 and open the ‘Header’ web template.
  • Paste the widget script you copied in earlier steps.

Live Assist - Header Template

  • Save the Web Template.

We are done with configurations and it’s time to test the Chat.

‘Live Assist’ Usage steps:

  • Open the Dynamics Portal URL and you should see a “Live Chat” button floating.

Live Assist Portal - 1

  • Click the button and start the Chat.

Live Assist Portal - 2

  • Message from Portal will be instantly delivered to CRM Agent.
    • Note: CRM Agent ‘Live Assist’ Status must be ‘Available

Live Assist - 1


Categories: ADX, CRM Tags: , ,

(401) Unauthorized Error – CRM integration with SharePoint

December 12, 2017 2 comments

We encountered below exception when we were integrating CRM with SharePoint.

Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Environment details:

  • CRM 2016 on-premise with Claims authentication enabled.
  • SharePoint Server On-premise with Claims authentication enabled.
  • User Account using to set up is Admin on both the CRM and Sharepoint servers.

Reason & Fix:

Fix suggested in this MSDN Forum worked for us.

It seems there is a known issue/bug with CRM 2016 that doesn’t allow this to work if you try using https in the MetadataEndPoint.

To get this working, you will have to temporarily do the following items before running the SharePoint Power Shell command.

Note : Make sure you note all the existing settings before executing below steps which helps you to roll back, if something goes wrong.


  1. Open the CRM Deployment Manager tool
    • Disable CRM IFD
    • Disable CRM Claims Configuration
  2. Open the IIS and remove the https binding on the CRM Web site and add back the http binding for the CRM Web site.
  3. Run CRM Deployment Manager and change the properties of the deployment for the Web Address to use http instead of https.
  4. Run an IISReset on the CRM Server to ensure this is now accessible via http.
  5. Run the SharePoint PowerShell commands (you should be able to access the MetadataEndpoint using http vs. https now if you put it in the browser (and it should prompt to download a .json file).
  6. Once the SharePoint commands are finished running, you need to reverse the changes above in CRM to re-enable IFD.
  7. Change the CRM Web Address to use https in the CRM Deployment Properties.
  8. Remove the http binding on the CRM Web site and add back the https binding, selecting the correct SSL Certificate.
  9. Run the Configure CRM Claims in the CRM Deployment Manager.  (keep the existing settings)
  10. Run the Configure IFD in the CRM Deployment Manager (keep existing settings).
  11. Run an IISReset on the CRM Server.

Refer MSDN article  which details integrating SharePoint on-premise with CRM on-premise.


Organization Insights – Dynamics 365

December 4, 2017 2 comments

What if your customer ask you to provide a report on the No of Active Users,Licenses, Most used entities etc. The answer is “Organization Insights” solution.

Organization Insights for Dynamics 365 (online) provides usage metrics for your Dynamics 365 organization, and tools to help you track and monitor the performance and support issues.

Steps to download and install:

  • Open the browser and login to your Dynamics 365 instance
  • Download the “Organization Insights” solution by click here

Organization Insights 1


Organization Insights 2

  • Click “Agree” and you will be redirected to Dynamics 365 Admin Center “Manage Solutions” page.

Organization Insights 3

  • Give it sometime to get the solution installed
  • After the solution installation navigate to your application (Settings -> Organization Insights)

Organization Insights 4

Organization insights provide below information once you installed:

Organization Insights 5

  • Active Usage Dashboard
    • Provide the details of
      • No of Dynamics 365 users
      • No of licenses are in use
      • List of custom entities that are used most frequently
    • Data in Dashboard updates every hour
  • System Jobs Dashboard
    • Will help us to monitor and troubleshoot workflows
    • Data in Dashboard updates every hour
  • Plug-ins Dashboard 
    • Will help us to monitor and troubleshoot plug-ins
    • Data in Dashboard updates every hour
  • Storage Dashboard
    • Provides a look at storage used by your tenant and instances
    • Data in Dashboard updates every day

Organization Insights - Data Storage

  • API Call Statics Dashboard
    • Will help us to to monitor and troubleshoot API calls.
    • Useful if you have any 3rd party system pull or push the data in to CRM.
    • Data in Dashboard updates every hour

Organization Insights 6

  • Mailbox Usage Dashboard
    • Will help us to monitor email mailbox usage like No of mail boxes, Active email server profiles etc.
  • Download Dashboard
    • Allow us to download the data selected for the date range in an Excel spreadsheet.
    • It provide details like: Most Used OOB and Custom Entities, Most Active Users Performing Operations (i.e., Retrieve/Retrieve Multiple/CRUD operations)

OData Support:

  • Organization Insights supports retrieving chart data through the Web API.

Refer below article for more info:


Manage your Instance Storage – Dynamics 365

December 4, 2017 Leave a comment

In this article I am detailing on

  • How to check the amount of storage organization is using
  • How to increase/purchase Additional storage
  • ways to reduce the amount of storage space

Storage limit depends on the type of subscription you purchase initially. For 30 days trail you would get 5 GB of storage. If you are run out of storage, you can add more.

Monitor the storage:

To monitor the storage consumption

Organization - Total Storage Used

Alternatively you can install “Organization Insights” solution to your Dynamics 365 and monitor the storage in detail.

Refer my article to know more about Organization Insights

Organization Insights - Data Storage

Increase/Purchase Additional storage:

To add additional storage

  • Login to your O365 Account’s Admin Center
  • Billing -> Purchase services

Admin Center - Purchase services

  • Under “Add-on subscriptions” choose “Dynamics 365 – Additional Database Storage”
    • Note: This is not available if you are on 30 days trail subscription.

Reduce the amount of storage space:

We can reduce the data storage by deleting certain categories of data as the need arises, or you can set up bulk deletion jobs to reoccur at set intervals.

A particularly important note is delete the data only if you are sure that it is no longer needed as you cannot get back the deleted data.

Below are the ways to reduce/free the data storage:

  • Delete bulk email and workflow instances using a bulk deletion job
  • Delete suspended workflows
  • Delete Email attachments if they are no longer required
  • Delete Notes with attachments if they are no longer required
  • Delete bulk duplicate detection jobs and associated copies of duplicate records
    • Every time that a duplicate detection job runs, a copy of each duplicate record is stored in the database.
    • Delete by navigating to Settings -> Data Management -> Duplicate detection jobs
  • Delete bulk import instances
    • Every time you perform a bulk import, there is a system job associated with that import.
  • Delete bulk Delete instances
  • Delete Audit Logs
    • Be cautious before deleting, as can no longer view the audit history for the period covered by that audit log.
    • Delete by navigating to Settings -> Auditing -> Audit Log Management -> Delete Logs

Refer below articles for more info.

Manage Storage

Free storage space


Categories: CRM, Dynamics 365 Tags: ,