MSBA-279 · Lesson 7 of 12 · 22 min
Domain review: developing integrations
▶ Video coming soon A video version of this lesson is on the way.
The integrations review was the shortest session of the course, by design. "Ten to fifteen percent," Rupert said. "Fourteen skills. You both built most of this in the fall. One evening of review, a set of questions, and move on." Wiremu was not so sure. He had designed the security dispatch webhook and helped with the alarm queue, but he had never written a plug-in that published to a service endpoint itself. Signe had, once, and admitted she had copied the pattern from the documentation. They spent the first half hour on that single skill.
The fourth domain, Develop integrations, is the smallest, at 10 to 15 percent, with three objective groups: publish and consume Dataverse events (4 skills), implement synchronization for Dataverse data (3) and create custom connectors (7). It was taught across Integrating Power Platform with Other Systems (MSBA-273) and Extending the Platform: Plug-ins, Custom APIs and Connectors (MSBA-272). Because the domain is narrow and technical, a candidate who knows the facts below can collect most of its marks.
Publishing Dataverse events
Dataverse can push the context of an operation to external systems through service endpoints. A service endpoint is registered once, then one or more steps are registered against it, just like plug-in steps: message, table, stage and mode. When the step fires, Dataverse sends the execution context, serialized as a RemoteExecutionContext, to the endpoint.
| Endpoint type | What it is | Use it when |
|---|---|---|
| Webhook | An HTTP POST to a URL you control, authenticated with a key in a header, query string or as a webhook key | A simple HTTP service must react; synchronous registration can even block the operation |
| Service Bus queue | A message in an Azure Service Bus queue | One consumer must process every event reliably, even if it is down for a while |
| Service Bus topic | A message in a topic with subscriptions | Several consumers each need their own copy |
| Event Hubs | An event in an Azure Event Hub | High-volume streaming to analytics or many readers |
| Service Bus relay (one-way, two-way, REST) | A message relayed to a listener | Older pattern for on-premises listeners; two-way returns a value |
Two skills cover how events are published. The first is the Plug-in Registration Tool: register the endpoint with its connection details, then register a step on it. This needs no code. The second is the IServiceEndpointNotificationService inside a plug-in. A plug-in gets this service from the service provider and calls its Execute method with a reference to the service endpoint and the execution context. That lets code decide whether and when to post, for example only when a calculated condition is true, and lets a two-way or webhook endpoint return a string to the plug-in.
var notify = (IServiceEndpointNotificationService)serviceProvider.GetService(typeof(IServiceEndpointNotificationService));
var endpoint = new EntityReference("serviceendpoint", dispatchEndpointId);
if (priority == 1)
{
string response = notify.Execute(endpoint, context);
trace.Trace("Dispatch endpoint returned: {0}", response);
}Endpoint behavior produces a handful of exam facts. Asynchronous registrations run as system jobs with retries, so a temporary outage at the receiver does not lose the event. A synchronous registration that fails rolls back the operation, which is powerful and dangerous: if the receiver is down, users cannot save. Webhook requests time out after 60 seconds, and large contexts are trimmed. Service Bus authentication uses a shared access signature in the endpoint configuration. There is no native Event Grid endpoint type; if a design needs Event Grid, a function or Logic App forwards events from Service Bus or a webhook receiver.
Recommending how to listen
One skill asks you to recommend options for listening to Dataverse events. This is a design question in disguise, and it is the most likely question in the group.
| Scenario | Recommend | Why |
|---|---|---|
| A maker wants an email when a high-priority case is created | Power Automate Dataverse trigger with a row filter | No code; managed by makers |
| A cloud service must update within seconds and can be down for maintenance | Service Bus queue endpoint, read by the service | Messages wait until the service returns |
| Three systems each need every change | Service Bus topic with three subscriptions | Fan-out with independent consumers |
| Thousands of telemetry events per minute to analytics | Event Hubs endpoint | Built for streaming volume |
| An external system syncs every hour and can tolerate delay | Change tracking with delta queries | Pull model; no event infrastructure |
| Analysts need tables in a lakehouse | Link to Microsoft Fabric or Azure Synapse Link | Managed analytics copies, not events |
Lumenvale's security dispatch case is a good model answer. The security office's dispatch tool had monthly maintenance downtime, so a webhook, which had been prototyped first, would have lost events or blocked saves during that window. Signe recommended a Service Bus queue instead, which buffered events until the dispatch tool came back. The exam phrase that signals this answer is any mention of the receiver being unavailable.
Synchronizing Dataverse data
The synchronization group has three skills: change tracking, alternate keys and the UpsertRequest message. Together they describe how to keep Dataverse and another system aligned without duplicates and without reading everything every time.
Change tracking is enabled per table. A client makes an initial request with the Prefer header odata.track-changes and receives the data plus a delta link. Later requests to the delta link return only rows created, updated or deleted since, with deleted rows marked as such, and a new delta link. With the SDK, RetrieveEntityChangesRequest does the same with a data version token. Change tracking data is kept for a limited period, seven days by default, so a client that waits too long must start again with a full read.
Alternate keys let a row be identified by business columns, such as a student number or an external system's ID, instead of its GUID. After a key is defined, Dataverse builds an index in the background; the key is not usable until the index is active. A Web API request can address a row by key, such as contacts(lcc_studentnumber='S1004417'), and lookups can be set by key on create or update.
Upsert creates the row if no row matches the key, or updates it if one does, in one request. With the SDK, an UpsertRequest takes an Entity whose KeyAttributes are set, and its response says whether a record was created. With the Web API, a PATCH to the key address performs an upsert, and headers such as If-None-Match or If-Match can limit it to create-only or update-only. For many rows, UpsertMultiple processes a batch in one call.
var contact = new Entity("contact", "lcc_studentnumber", studentNumber);
contact["firstname"] = firstName;
contact["lastname"] = lastName;
var response = (UpsertResponse)service.Execute(new UpsertRequest { Target = contact });
trace.Trace(response.RecordCreated ? "Created {0}" : "Updated {0}", studentNumber);Worked problem
Designing a nightly sync
A supplier system exports supplier records with its own supplier code. Each night, new suppliers must be created in Dataverse and changed ones updated, without duplicates, and the supplier system must learn which suppliers changed in Dataverse since the previous night. What should the design use?
Show solution
- Inbound: an alternate key on the supplier code, so rows are matched by business key.
- Inbound: UpsertMultiple or UpsertRequest, so one call creates or updates without a prior lookup.
- Outbound: change tracking on the supplier table, storing the delta link each night.
- Keep the nightly interval well within the change tracking retention period.
Answer: Alternate key plus upsert for the import, and change tracking with delta links for the export. This is the pattern in the LedgerPoint sync design reviewed in the integrations course.
Custom connectors
The custom connector group has seven skills, the most in the domain: authentication, policy templates, importing definitions, connectors for Azure services, Azure Functions for connectors, OpenAPI extensions and custom code.
| Skill | Facts to know |
|---|---|
| Authentication | No authentication, basic, API key, or OAuth 2.0, including Microsoft Entra ID and generic OAuth providers; each connector can have its own redirect URI |
| Policy templates | Change requests and responses at run time without code, for example to set an HTTP header or set the host URL from a connection parameter |
| Import definitions | Start from an OpenAPI definition, a Postman collection, an Azure service such as API Management or Azure Functions, or a connector from GitHub |
| Connector for an Azure service | Expose an Azure-hosted API, often secured with Microsoft Entra ID, to apps and flows |
| Azure Function for a connector | Write an HTTP-triggered function that the connector calls, when logic is too heavy for connector code |
| OpenAPI extensions | x-ms-summary for friendly names, x-ms-visibility to hide or promote parameters, x-ms-dynamic-values and x-ms-dynamic-schema for lists and shapes from the API, x-ms-trigger for triggers |
| Custom code | One C# script class deriving from ScriptBase with ExecuteAsync; send requests through Context.SendAsync; size and time limits apply, with a two-minute timeout for new connectors |
The most common connector questions ask which tool to use for a transformation. If the change is simple and declarative, such as adding a header or routing to a different host, a policy template fits and needs no code. If the change requires logic, such as reshaping a response or computing a value, custom code in C# fits, within its limits. If the logic is heavy, needs packages that custom code cannot use or takes longer than custom code allows, an Azure Function behind the connector fits. Wiremu's Parcelwise connector used all three ideas in miniature: a policy to set a client header, a policy to choose the sandbox or production host from a connection parameter, and a small piece of custom code that added a UTC timestamp to tracking events.
Authentication questions mirror the platform API ones. A connector that must act as the signed-in user, seeing only what that user is allowed to see, uses OAuth 2.0 with delegated permissions; the Student Records connector at Lumenvale used Microsoft Entra ID this way. A connector to a partner API that issues one key per customer uses API key authentication, with the key held per connection; the LedgerPoint read-only API used this, with the key stored in Azure Key Vault on the service side and rotated with two keys.
Dynamic values are a favorite detail. A connector action that takes a service level should not make users type a code; with x-ms-dynamic-values pointing at another operation, such as an internal "Get service levels", the flow designer shows a list. That internal operation is usually hidden from makers with x-ms-visibility set to internal.
"parameters": [
{
"name": "serviceLevel",
"in": "query",
"type": "string",
"x-ms-summary": "Service level",
"x-ms-dynamic-values": {
"operationId": "GetServiceLevels",
"value-path": "code",
"value-title": "name"
}
}
]Webhook details that decide questions
Webhooks are the simplest endpoint and therefore the one most often offered as a tempting wrong answer. Know their limits. Dataverse sends an HTTP POST with the serialized execution context in the body and identifying headers. Authentication is one of three options set on the endpoint registration: a webhook key, which Dataverse sends as a code value in the query string; a set of HTTP headers; or a set of query string values. The receiver must respond within 60 seconds with a success status. Asynchronous registrations are retried as system jobs; synchronous ones that fail roll back the operation and show the user an error. Very large contexts are trimmed, so a receiver that needs many columns should read them back from Dataverse rather than rely on the posted context.
Security questions about webhooks have a predictable answer. The receiving endpoint is public by necessity, so it must validate the key or header on every request and reject anything else, and the key should be rotated like any secret. If the scenario says the receiver must not be reachable from the internet, a webhook is the wrong tool; a Service Bus queue, which the receiver reads from inside its own network, is the right one.
| Fact | Webhook | Service Bus queue endpoint |
|---|---|---|
| Receiver must be online | Yes, or the call fails | No, messages wait |
| Receiver exposed to the internet | Yes, an HTTPS URL | No, it reads from the queue |
| Authentication | Webhook key, headers or query string values | Shared access signature on the namespace or queue |
| Timeout | 60 seconds | Not applicable to the consumer's processing |
| Several consumers | Register several webhooks | Use a topic instead of a queue |
Importing connector definitions
The skill on importing definitions names OpenAPI definitions, Azure services and GitHub. An OpenAPI 2.0 definition, as a file or URL, is the most common starting point and gives the connector its operations, parameters and schemas at once. A Postman collection can also be imported. For Azure, the custom connector wizard can start from an API in Azure API Management or from an Azure Functions app, which saves writing the definition by hand. From GitHub, developers can start from the open-source connector definitions that Microsoft and partners publish, and the Power Platform CLI can download and update connector definitions so they live in source control. Whatever the source, the imported definition usually needs editing: friendly summaries, visibility settings and dynamic values are rarely present in a definition written for developers.
Worked problem
A connector design question
A team has an Azure Function app that wraps a legacy inventory system. Makers need to call it from flows with friendly parameter names, and one parameter should offer a list of warehouses. The function app is secured with Microsoft Entra ID. What steps fit?
Show solution
- Start from the Azure Functions app in the custom connector wizard, or from its OpenAPI definition.
- Set authentication to OAuth 2.0 with Microsoft Entra ID, using an app registration for the connector and the function app's application ID URI as the resource.
- Add x-ms-summary to parameters and x-ms-dynamic-values pointing to a "list warehouses" operation, marked internal with x-ms-visibility.
Answer: Import from the function app, configure Entra ID OAuth, and add the OpenAPI extensions for friendly names and the warehouse list. No custom code is needed.
Common mistakes
MistakeUsing a synchronous webhook to a service that has maintenance downtime.
InsteadUse an asynchronous Service Bus queue endpoint so events wait for the service.
MistakeRegistering Azure Event Grid as a Dataverse service endpoint.
InsteadThere is no Event Grid contract; forward from Service Bus or a webhook receiver if needed.
MistakeMatching imported rows by querying first and then creating or updating.
InsteadDefine an alternate key and use upsert.
MistakeWriting custom code to add a fixed header to every connector request.
InsteadUse the Set HTTP header policy template.
Summary and key terms
- Domain 4 is worth 10 to 15 percent with 14 skills in three groups.
- Service endpoints include webhooks, Service Bus queues and topics, relay and Event Hubs; publish with the Plug-in Registration Tool or IServiceEndpointNotificationService.
- Recommend listeners by need: flows for makers, queues for reliability, topics for fan-out, Event Hubs for volume, change tracking for periodic sync.
- Synchronize with change tracking and delta links, alternate keys and upsert.
- Custom connectors: choose authentication by identity needs; policies for declarative changes, C# custom code for logic, Azure Functions for heavy work; OpenAPI x-ms extensions improve the maker experience.
- Service endpoint
- A Dataverse registration that sends event context to a webhook, Service Bus or Event Hubs.
- RemoteExecutionContext
- The serialized execution context sent to a service endpoint.
- IServiceEndpointNotificationService
- A plug-in service that posts the context to a registered endpoint from code.
- Change tracking
- A table setting that lets clients retrieve only rows changed since a previous request.
- Delta link
- A URL returned by a change tracking request for retrieving later changes.
- Alternate key
- One or more columns defined as a unique business key for a table.
- Policy template
- A configurable rule that changes custom connector requests or responses at run time.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Which endpoint type fits several independent consumers that each need every event?
Show answer
A Service Bus topic with one subscription per consumer.
What must exist before a row can be addressed by an alternate key?
Show answer
An active index for the key, built in the background after the key is defined.
Which OpenAPI extension provides a list of values from another operation?
Show answer
x-ms-dynamic-values.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.