Posts

🔐 How Azure API Management Passes OAuth Tokens to Power Automate Using Managed Identity

  A deep‑dive guide for enterprise integration teams Modern integration patterns increasingly rely on secure, scalable, identity-driven connectivity.Systems such as IOM, ERP, and retailer integrations often speak to each other through Azure API Management (APIM) , which then forwards payloads to Power Automate cloud flows  APIM acts as the single controlled ingress point, routing traffic to cloud flows configured behind secured endpoints rather than exposing them directly.  One question always comes up: How does APIM obtain an OAuth token and pass it to a secure Power Automate endpoint? The answer lies in a powerful Azure feature: Managed Identity . This article breaks down the complete lifecycle—from token acquisition to validation—along with best practices used internally across our integration landscape. 1. Why Use Managed Identity Instead of Client Secrets? Traditionally, calling an OAuth‑secured Flow/Logic App required: An App Registration A Client ID + Client Secre...

Topics in Copilot

  What Are Topics in Copilot? A Simple Explanation If you’re building a copilot using Copilot Studio (formerly Power Virtual Agents) , Topics are the foundation of how your copilot understands users and responds intelligently. At a high level, a Topic represents a user’s intent plus the conversation flow that should run when that intent is detected. Topics: The Building Blocks of a Copilot Whenever a user types a message, Copilot evaluates it against all available topics. Each topic contains example phrases that represent what the user might say. When Copilot finds the best match, it activates that topic and runs its associated conversation. In other words: User message → Topic match → Conversation flow What Makes Up a Topic? A topic is made of a few essential parts: Trigger phrases define when the topic should start. These are example user messages like “check order status” or “create a new order.” Conversation flow is the logic of the interaction. This is designed...

Why Semicolons Matter in Dynamics 365 JavaScript

  When writing JavaScript for Dynamics 365 / Dataverse forms , semicolons are not just style preferences — they are defensive coding tools . A single missing semicolon can silently break your form, prevent events from firing, or stop your Custom API calls from executing. In this post, we’ll walk through real CRM-style examples , explain why semicolons are required , and show what can go wrong if you skip them . 1️⃣ Namespaces: The Foundation of CRM JavaScript In Dynamics, we avoid global pollution by using namespaces. ✅ Correct Pattern var DCash = DCash || {}; DCash . ItemsUploadJob = DCash . LinkItemsUploadJob || {}; Why this works DCash || {} ensures the object exists Prevents conflicts with other scripts Supports large projects with multiple JS files ✔ Semicolons are required because these are variable assignments 3️⃣ Function Expressions (Most Common CRM Pattern) This is where many CRM developers make mistakes. ✅ Correct DCash . LinkItemsUploadJ...

Key Vault Retrieve for Plugin in Dataverse

  ✅ 1. Client Secret (Azure AD App Secret) This is used for authentication . What it is A client secret belongs to an App Registration in Azure AD. Think of it as: “The password of an application.” Used for ✔ Proving the identity of your Azure AD Application ✔ Getting an access token from Azure AD ✔ Allowing your Dataverse plugin to say: “Hi Azure AD, I am App XYZ. Here’s my password. Please let me access Key Vault.” Without the client secret You cannot authenticate → You cannot access Key Vault → You get 401 Unauthorized . ✅ 2. Key Vault Secret (Stored Secret) This is the actual secret you want to retrieve from Key Vault. Examples API keys Database connection strings Access tokens Certificates Any sensitive data you stored in the vault Used for ✔ Being protected in Key Vault ✔ Retrieved only after authentication ✔ Not related to Azure AD login password This is what the Key Vault returns only if the caller is authorized . 🔥 Key Diff...

Best Practices for Calling Power Automate from Dataverse or Plugins

  Best Practices for Calling Power Automate from Dataverse or Plugins Avoid timeouts • Improve performance • Enable scalable async processing Integrating Dataverse (Dynamics 365 CRM) with Power Automate is common, but many implementations accidentally create slow forms, plugin timeouts, and reliability issues. The key is understanding how to call a flow safely and efficiently —without blocking CRM operations. Below are the recommended best practices used in enterprise-grade CRM systems. ✅ 1. Use “Fire-and-Forget” Calls Plugins and Custom APIs must remain fast. CRM has strict limits: Plugin timeout: 2 minutes HTTP calls: block CRM until response arrives Form commands need to return instantly Best practice: Call Power Automate in a non-blocking way by letting the flow return 202 Accepted immediately and continue its work in the background. Why it matters Power Automate may need time to: call Azure Functions write to Dataverse talk to external APIs ...

Power Automate Error Exception

 In Power Automate, the expression: actions ('Try')? [ 'error' ]? [ 'message' ] is used to retrieve the error message from a failed action—typically inside a Scope , Try/Catch pattern , or Configure run after setup. What This Expression Does actions('Try') → Refers to the action named Try (usually inside a Try scope). ?['error'] → Safely navigates to the error object (using ? prevents failure if it doesn't exist). ?['message'] → Retrieves the actual error message string. So effectively, this expression gives you the error message produced by the Try action . 🧩 Where You Use This Typically inside the Catch scope of a “Try → Catch → Finally” pattern in Power Automate: Create a Scope called Try Create a Scope called Catch Set Catch to run only when Try has failed Inside Catch , use the expression above to extract the error 📌 Example: Compose Action Inside Catch Add a Compose action and in...

Item vs Items in PowerAutomate

  💡 Meaning of items() in Power Automate In Power Automate, items() is a function that represents the current item being processed inside a loop , such as an Apply to each action. Think of it like this 👇 If you have a list of rows and Power Automate loops through them one by one — items() refers to the single row currently being processed. 🧩 Example Suppose: Your “List rows” ( List_rows_1 ) returns: { "body" : { "value" : [ { "fullname" : "John Doe" , "emailaddress1" : "john@contoso.com" } , { "fullname" : "Jane Smith" , "emailaddress1" : "jane@contoso.com" } ] } } You then add an Apply to each action: Apply to each: value = outputs ( 'List_rows_1' )?[ 'body/value' ] Inside this loop: On the first iteration , items() = { "fullname" : "John Doe" , "emailaddress1" : ...