Integrating Dynamics 365 with Azure Function using Managed Identity

March 20, 2019

I love Azure Functions. These days, I have to restrain the tendency to solve every problem with this Swiss army knife.  When designing Azure Function integration with Dynamics 365, one of the immediate questions raised is where to store connection strings, credentials and other sensitive details.  The immediate answer is ‘Not in your code’. So where?One option is to store sensitive details in the Application Settings store which is ‘encrypted at rest and transmitted over an encrypted channel.’ While this option is  quite easy to use, it isn’t considered most secured. Another option is using Managed Identity...

Implementing Lead Landing Page with Flow (in 10 min. or less)

February 24, 2019

Microsoft Flow, along with Logic Apps, Power Apps and CDS has revolutionized integration with Microsoft Dynamics 365. I have been working with Dynamics products since 2005 and when comparing the resources required back then to hook up a landing page to Dynamics, I estimate that modern solutions require less than 5%. In addition, you don’t have to be an expert developer to implement simple integration scenarios, as declarative mechanisms like Flow and Logic Apps can handle the heavy lifting.     In this post I’ll walkthrough the process of Implementing a Lead Landing Page with Flow while writing the minimum amount...
no comments

Referencing Dynamics Assemblies with Azure Function Apps v.2

February 19, 2019

Just stumbled upon a new  Azure environment, where Azure Function Apps have been upgraded to version 2. Right away, noticed that my Azure Function code referencing Dynamics assemblies does not compile, complaining aboutThe type or namespace name 'Xrm' does not exist in the namespace ‘Microsoft' (are you missing an assembly reference?) After digging around, I found out that the project.json is not longer valid with v.2.Instead, the function.proj file must be created and reference Dynamics assemblies in the following manner:       461              

Microsoft Graph API – Assign DYN365 License to AAD User

December 27, 2018

The automated process of user provisioning becomes common in many projects. Often, the process includes components outside of Dynamics 365 such as  creating a user in Azure Active Directory, assigning plans and licenses and adding user to AAD groups. All of these can be automated using the Microsoft Graph API. In this post, I’ll demonstrate assigning Microsoft Dynamics 365 license to an existing user with Postman. You can later convert Postman requests to JS or C# code or use in Flow and Logic Apps. Prerequisites Have Postman application installed Have access to Office 365 and...
no comments

Auto Backup Dynamics 365 Solution using Flow & Dropbox

December 24, 2018

Harnessing the scaffold suggested in my last post, I would like to suggest a simple way to automatically backup Dynamics 365 solution with Flow/Logic Apps. The following Flow will allow you to copy Dynamics 365 solution file into Dropbox account on schedule for backup or any other purpose.You can download the scaffold Flow solution here and import into your Flow environment. Then, update the necessary details according to the following walkthrough. The last Dropbox related Action is not included, you’ll add it yourself. Prerequisites Access to Microsoft Dynamics 365 online instance and Flow environment Register...
no comments

Executing Web API Calls from Flow/Logic Apps

November 22, 2018

While writing my previous post regarding Flow as a scheduling mechanism,  I stumbled across this post demonstrating how to execute Web API calls from Flow. Why would you want to execute Web API calls from Flow/Logic Apps?While Microsoft Flow/Logic Apps support basic Dynamics 365 operations, there are many missing functions that can simplify common integration scenarios between these platforms: executing Custom Actions, triggering Processes, handling metadata and issuing complex queries. Some of these problems can be worked around using the Command Pattern, but using the Web API from within Flow/Logic Apps provides a simple and powerful integration mechanism.   ...
no comments

Execute a Recurring Job in Microsoft Dynamics 365 with Flow

November 11, 2018

I have written about executing recurring jobs in Dynamics 365 few times in the past. Over time, I suggested different scheduling mechanisms such as Microsoft Dynamics Workflow Timeout step or Azure Scheduler, as the pattern I suggested allows changing the scheduling mechanism without impacting other solution parts. Flow can be also used as a scheduling mechanism, one that does not require coding like Azure Function,  as it has a built in integration with Microsoft Dynamics 365 Online. Once invoked on schedule, the executing component query Dynamics 365 for target business records and apply some business logic (Process) to each business record. In...

Custom Code Tracing & Exception Logging in Dynamics 365 v.9

October 28, 2018

As a Solution Architect I often review Microsoft Dynamics 365 custom server and client side code. One of the most common rejects regards tracing and exception handling mechanisms, or their absence. Some code constructs may have empty Try/Catch blocks or none at all, other catch exceptions and just re-throw. As for tracing, code often contains debugging ‘aids’ such as alerts and debugger statements or no tracing notifications at all. Why is this a reject? Unhandled raw exceptions float to UI, confusing and frustrating users while exposing internal implementation details to potential attackers System Administrator is unaware of custom code exceptions unless users decide...
no comments

Drag & Drop File Upload Revisited

October 18, 2018

Finally found the time for overdue maintenance on the Drag & Drop solution I created two years ago. Why revisit? First of all, as the CodePlex platform, previous home of this solution, is being decommissioned, downloading the component got the whole CodePlex project and few visitors commented that they could not find the actual solution. So now you can download an unmanaged solution from it’s  new home @ Github. Second, I fixed a major bug related to the plural name of some entities. For most entities, appending ‘s’ to the entity schema name would result in the matching entity name for Web API. Some...
no comments

Microsoft Portal – Retrieve Dynamics 365 Data Asynchronously – Part 2

October 15, 2018

In part 1 of this post I demonstrated building and using a service which receives a FetchXML query and returns Dynamics 365 data to any Portal page in an asynchronous manner as a JSON object. This service is similar to the SDK’s RetrieveMultiple message. In this part 2, I’ll demonstrate a different service, which like the SDK Retrieve message, receives a record type, record id (GUID) and columns set to return the required data as a JSON object. This is useful when you already have a specific Dynamics 365 record id at hand and you want to retrieve additional data for...