Power Automate: Use Service Principal

Let’s talk about Power Automate and how to use the Service Principal account to run your Power Automate jobs?

Why do we need Service Principal? Let suppose you have created a background automation which is using Common Data Service (CDS) triggers or actions, so its better to use service principal rather than to a specific user (because specific user may leave the company, his account can be disabled).

Following is the 3 steps guide with reference:-



  • In Power Automate use ‘Connect with Service Principal’


In case, if you have any question feel free to ask in the comments. 🙂

Sponsored Post Learn from the experts: Create a successful blog with our brand new courseThe WordPress.com Blog

WordPress.com is excited to announce our newest offering: a course just for beginning bloggers where you’ll learn everything you need to know about blogging from the most trusted experts in the industry. We have helped millions of blogs get up and running, we know what works, and we want you to to know everything we know. This course provides all the fundamental skills and inspiration you need to get your blog started, an interactive community forum, and content updated annually.

Dynamics 365: Solution install failed

Author By: Zohaib Uddin Khan


Let suppose you’re trying to install a managed solution (such as Project Services Automation, Field Services, Portal, etc.) through Admin Center and you’re facing ‘Solution Installation Failed‘.

Since, Admin Center don’t provide any reason for failure, apart from retry or contact the support which are not very productive.




Go to Dynamics 365 Org – Settings – Customization – Solution History


Open the latest or related solution from ‘Internal Solution History’ view. And, reason for the failure of the solution is available under Exception Message. 🙂


D365: Limitations of Duplicate Detection Rules

Author: Zohaib Uddin Khan

Duplicate detection is one of the old and powerful feature of Dynamics family. But, I found it has some major limitations and inconsistency. I tried to use them in every implementation but reach to a point where I decided not to use them is my best bet. Anyhow, following are the ones which bother me heaps:-

  • Duplicate detection works with Dynamics 365 for tablets, but isn’t available for Dynamics 365 for phones.
  • Duplicates can’t be detected when a user converts a lead and it will create Account/Contact automatically.
  • Duplicates also aren’t detected when a user changes the status of a record, such as activating or reactivating it.
  • Maximum 5 Duplicate detection rules under Published state per Entity.

In case, if you found or know any other then feel free to comment and I will update the post. Cheers!

Connecting to CRM 2013/2015/2016 and Dynamics 365 in C#

Dynamics CRM 2013/2015/2016/Dynamics 365

In our day to day tasks we often need to connect CRM in C# either in a plugin, a console application or a service. In this article I will present different ways to do that.

Method 1
Use this method to connect when you want to use your connection info directly in code. This method can be used for CRM 2013/2015/2016.

Method 2
Use this method to connect with CRM 2013/2015/2016 when your connection info is in config file.

Config settings will be like this

Method 3
Use this method to connect with CRM 2013/2015/2016 when your connection string is in config file.

Config settings will be like this

Method 4
User this method to connect with Dynamics 365 On-Premise

//– Note: In order to use CrmServiceClient class, you need to use namespace “Microsoft.Xrm.Tooling.Connector” which exists in Dynamics 365 Dll named “Microsoft.Xrm.Tooling.Dll”

Config settings will be like this

Method 5

View original post 21 more words

Dynamics 365 v9: Limitations Of Unified Interface

AuthorZohaib Uddin Khan

Version:  Dynamics 365 v9

On the other day, I had a conversation with Andrew Ly (MVP) and he shared with me that there are a couple of well-known functionalities which are not available in Unified Interface. Then, I started looking into this matter and I was just stunned!!

Limitations of Unified Interface:

  • Advanced Find is missing (Global as well as on the list views).
  • Bulk Update records by selecting two or more records is not available.
  • Run Workflow is missing in a view.
  • No filters available on columns in a view.
    • After adding ‘Editable Grid’ control, filter feature will be available.
  • Run Report is missing from view.
  • Bulk Delete is missing in a view.
  • Quick create for Activities and Custom entities is not available.
  • Sitemap Designer behavior is not consistent. I configuredCampaign, Quick Campaign and Work order, but they are not appearing in the App while browsing.
  • [Misunderstanding, my bad!] Through App/Sitemap Designer, I didn’t expose the ‘Case’ entity. But, ‘Case’ entity is marked for ‘Quick Create’ and Security role has the access to it. So, I can create the case record through ‘Quick Create’ button. Make sure Security role is updated for the App accordingly.

I’ll keep updating this list based on new findings. Ciao!

Dynamics 365 Session and inactivity timeout

Author: Zohaib Uddin Khan

Version:  Dynamics 365 v8.1 and onwards


In this blog, we will be discussing two features which are available under Dynamics 365 – Settings – Administration – System Settings

  • User session timeout
    • A user is not required to log in with their credentials for up to 24 hours regardless of whether the user was active or inactive.
  • Inactivity timeout
    • A user can remain logged in the application until the session timeout expires.

Both of the above features can have custom values set by System Administrators.

Limitation of Inactivity timeout:

In the following cases, inactivity timeout wouldn’t get enforce:-

  1. Dynamics 365 for Outlook
  2. Dynamics 365 for phones and Dynamics 365 for tablets
  3. Unified Service Desk client using WPF browser (Internet Explorer is supported)
  4. Live Assist (Chat)

More information can be read here.



Dynamics 365 Portal – Access Denied on all pages

Author: Zohaib Uddin Khan

Credit to this Solution: Chid


I’m browsing the ‘Dynamics 365 Portal’ Homepage and I’m always redirected to Login page. I even tried to directly access the Images/JavaScript/CSS files, but still redirected to Login page.


Since I come from web development background, so restart the portal and clear cache of the browser are my first bet. And, I highly recommend doing that in case you are experiencing absurd behavior. But, in my case, the problem didn’t get solved. Luckily, I found a thread on MS Community forum where I found the solution:

  • Do ‘Advanced Find’ the entity ‘Publishing States’.
  • Open the ‘Published’ record for your portal. In one Dynamics 365 organization, the number of ‘Published’ records is equal to the number of portals configured.
  • Make sure IsVisible and IsDefault are checked as shown below:


Dynamics Portal 365 – Resolving Errors

Reached office, grabbed the hot latte and I was informed that Dynamics Portal 365 is not working. Bummer!!

So the exception is,


Since I don’t have the Psychic powers, so I start looking into more descriptive and informative exception log. In order to find more information about the exception, you have to ‘Disable Custom Errors’ for the portal.

Following are the Steps to do:-

  • Log in with your Global Administrator to Dynamics 365 Administration Center > Applications.
  • Select your Portal application and click on ‘Manage’ button.


  • Click on ‘Portal Actions’ and ‘Disable Custom Errors’


  • Browse your Dynamics 365 Portal and viola!!



Dynamics 365 for Marketing Public Preview

Yes, you’re reading right, Dynamics 365 for Marketing Public Preview is available for trial. So, let’s start making our hands dirty like a sparky.

  1. Browse for Dynamics 365 for Marketing trial.
  2. Follow the simple sign-up and Marketing setup process.
  3. Once Marketing setup process gets completed, you will be landed in Dynamics 365 for Marketing. In my case, it took more than an hour to complete the setup.
  4. After the browsing, I realize it has two broad categories:
    1. Marketing.
    2. EventsD365-Marketing-1
  5. In the Marketing section, following are the important ones:
    1. Activities.
    2. Customers.
    3. Marketing Execution.
    4. Lead Management.
    5. Internet Marketing. (New area to explore)
    6. Templates.
    7. LinkedIn Lead Generation. (New area to explore)
  6. In the Event section (fairly new area to explore), following are the important ones:
    1. Events (registration)
    2. Participants.
    3. Venue Management.
    4. Logistics.
    5. Sponsorship Management.
    6. Post Event actions.

I didn’t get much time to explore, but its worth to put an extra mile to explore. I’ll write another couple of detailed post for the new area. Till then Ciao!


Fit Requirements into D365 Features, Not Features into Requirements

I would like to present my advance apologies if you disagree with me but give another thought about it. OK, let’s start with the conclusion first and then we will discuss in detail.

Fit Requirements into D365 Features, Not Features into Requirements

For some time, I noticed that whenever Dynamics Product team release some new cool features into D365, we start talking about them and by all means we try to utilize these new features in our next implementation no matter whether requirements need these features or not. I’m not saying don’t use new features but here my point is to do proper Fit-Gap analysis and identify whether the new feature is needed in our next implementation or not. If requirements can easily be achieved by the features which are available from CRM 4.0/2011, then go ahead and design your system using those old features. There is no harm to use them, you don’t need to impress someone who is sitting next to you. Take the accountability and trust your guts!


Example: Let me drag you into the Music industry and we will analyse through this example.

  • Every day some new songs are coming, we start listening them dozens of times a week.
    • Why? because we love it at that moment, but it doesn’t mean we will use this song for some special event or occasion.
  • We still love to listen to the songs of 90’s or older.
    • Why? because our mood wants to listen to them, even they are old but still we love it!

So, our mood and special event or occasion become our Requirements and Songs become our Features.

p.s. Ed Sheeran and Katy Perry are my recent favourites.