Posts

Understanding FakeXrmEasy Test Flow in Dynamics 365 CRM

  Why We Add Entities to MergeSalesOrdersBase When writing unit tests for Dynamics 365 CRM plugins using FakeXrmEasy, one of the most confusing concepts is: Why do we need to add entities into _entities when we already use .ToEntityReference() ? This article explains the complete testing flow step by step. The Real Problem Suppose you have a Sales Order: var salesOrder = new SalesOrder { new_ContosoSalesOrderType = ContosoSalesOrderTypes . AcknowledgementTrue . ToEntityReference () }; At first glance, it feels like the Sales Order Type already exists. But internally, that is NOT true. .ToEntityReference() only stores: Logical Name GUID Example: new_contososalesordertype GUID = 12345 It does NOT store the actual entity fields. So fields like: new_AllowSalesOrderAcknowledgments new_AllowMerging new_AllowSubstitutes are NOT available unless the entity itself is added into FakeXrmEasy. Understanding the Complete Test Flow Step 1 — Base Class Runs First Your test inher...

🔐 How APIM Passes OAuth Tokens to Power Automate Using Managed Identity

  A Complete Enterprise Integration Guide Modern enterprise integrations rely on secure, identity-driven communication rather than static credentials. In architectures where Azure API Management (APIM) acts as the gateway and Power Automate flows act as backend orchestrators, authentication must be both secure and scalable. The recommended approach is to use Managed Identity for OAuth token acquisition and transmission. 1. Why Managed Identity? Traditionally, OAuth-based integrations required: App registrations Client ID + Client secret Secret storage and rotation Manual configuration in APIM Managed Identity eliminates these concerns: No secrets to manage Identity bound directly to the APIM instance Automatic token issuance by Azure AD (Entra ID) Strong alignment with Zero Trust security principles 2. High-Level Authentication Flow Client → APIM → Managed Identity → Azure AD → Access Token → Power Automate Flow Flow Breakdown Client sends request to APIM APIM acts as the controll...