Skip to content

Commit 41085ec

Browse files
authored
Merge pull request #10334 from MicrosoftDocs/phecke-servicebus
Azure ServiceBus interface to Dataverse updates
2 parents 835adb8 + eb86c40 commit 41085ec

File tree

4 files changed

+45
-52
lines changed

4 files changed

+45
-52
lines changed

powerapps-docs/developer/data-platform/azure-integration.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Azure integration (Microsoft Dataverse) | Microsoft Docs"
33
description: "Learn how Microsoft Dataverse can be configured to send data to the Azure cloud."
44
ms.collection: get-started
5-
ms.date: 03/22/2022
5+
ms.date: 07/17/2024
66
ms.reviewer: "pehecke"
77
ms.topic: "article"
88
author: "jaredha"
@@ -11,13 +11,13 @@ ms.author: "jdaly"
1111
search.audienceType:
1212
- developer
1313
contributors:
14-
- PHecke
14+
- pehecke
1515
---
1616
# Azure integration
1717

1818
[!INCLUDE[cc-terminology](includes/cc-terminology.md)]
1919

20-
Microsoft Dataverse supports integration with Azure. Developers can register plug-ins with Dataverse that can pass runtime message data, known as the execution context, to one or more Azure solutions in the cloud. This is especially important because Azure is one of two supported solutions for communicating runtime context obtained in a plug-in to external line-of-business (LOB) applications. The other solution is the external custom endpoint access capability from a plug-in registered in the sandbox.
20+
Microsoft Dataverse supports integration with Azure. Developers can register plug-ins with Dataverse that can pass runtime message data, known as the execution context, to one or more Azure solutions in the cloud. This capability is especially important because Azure is one of a few supported solutions for communicating runtime context to external line-of-business (LOB) applications.
2121

2222
The Azure Service Bus provides a secure and reliable communication channel between Dataverse runtime data and external cloud-based line-of-business (LOB) applications. This capability is especially useful in keeping disparate Dataverse systems or other Dataverse servers synchronized with business data changes.
2323

@@ -27,58 +27,59 @@ The Azure Service Bus provides a secure and reliable communication channel betwe
2727

2828
### Data Context
2929

30-
The *data context* contains the business data that is being processed as part of the current Dataverse operation. This processing was initiated when a request to perform a certain operation was made by a user, workflow, or application, to the Dynamics 365 platform. The data context is passed to any plug-ins or custom workflow activities that are registered with the event pipeline to execute on the specific request and table combination that is currently being processed. The data context is of type <xref:Microsoft.Xrm.Sdk.IPluginExecutionContext> when it is being passed along the event execution pipeline and <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext> when it is posted to the Service Bus.
30+
The *data context* contains the business data that is being processed as part of the current Dataverse operation. This processing was initiated when a request to perform a certain Dataverse operation was made by a user, workflow, or application. The data context is passed to any plug-ins or custom workflow activities that are registered with the event pipeline to execute on the specific request and table combination that is currently being processed. The data context is of type <xref:Microsoft.Xrm.Sdk.IPluginExecutionContext> when when passed along the event execution pipeline and <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext> when posted to the Service Bus.
3131

32-
The data context contained within the message that is posted to the Azure Service Bus can be formatted in XML or JSON in addition to the default .NET binary format. This allows for cross-platform interoperability where Azure hosted non-.NET clients can read Dataverse data from the service bus.
32+
The data context contained within the message that is posted to the Azure Service Bus can be formatted in XML or JSON in addition to the default .NET binary format. Support for such data formats allows for cross-platform interoperability where Azure hosted non-.NET clients can read Dataverse data from the service bus.
3333

3434
> [!IMPORTANT]
3535
> When the size of the entire HTTP payload exceeds 192Kb, the following properties will be removed:
3636
>
37-
> - <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.ParentContext>
38-
> - <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.InputParameters>
39-
> - <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.PreEntityImages>
40-
> - <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.PostEntityImages>
37+
> <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.ParentContext>,
38+
> <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.InputParameters>,
39+
> <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.PreEntityImages>,
40+
> <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext.PostEntityImages>
4141
>
4242
> Some operations do not include these properties.
4343
>
4444
> - If the size of the payload is below 192Kb after the additional data is removed, an additional `MessageMaxSizeExceeded` property is added to the [BrokeredMessage](/dotnet/api/microsoft.servicebus.messaging.brokeredmessage) sent by the system. This indicates that some of the data has been truncated.
4545
> - If the size of the payload exceeds 192Kb after the additional data is removed, an error occurs and the message is not sent.
4646
4747
For more information about the technologies described earlier, see:
48-
- [Event execution pipeline](event-framework.md#event-execution-pipeline)
49-
- [Write a listener application for a Microsoft Azure solution](write-listener-application-azure-solution.md).
48+
49+
- [Event execution pipeline](event-framework.md#event-execution-pipeline)
50+
- [Write a listener application for a Microsoft Azure solution](write-listener-application-azure-solution.md).
5051

5152
### Plug-ins
5253

53-
Plug-ins are one of two methods used to initiate posting the message containing the data context to the Azure Service Bus, the other method being a custom workflow activity. There are two kinds of plug-ins supported by the Dataverse-Azure connection feature: out-of-box (OOB), and custom. In either case, it is recommended that you register the plug-in to run asynchronously for best system performance.
54+
Plug-ins are one of two methods used to initiate posting the message containing the data context to the Azure Service Bus, the other method being a custom workflow activity. There are two kinds of plug-ins supported by the Dataverse-Azure connection feature: out-of-box (OOB), and custom. In either case, it's recommended that you register the plug-in to run asynchronously for best system performance.
5455

55-
An Azure-aware OOB plug-in is provided with Dataverse and can be registered using the Plug-in Registration tool. This plug-in executes in full trust with the Dataverse platform. You must register a plug-in 'step' in the event execution pipeline that identifies the message and table combination that triggers the plug-in to execute and perform the posting notification. When executed, the plug-in notifies the asynchronous service, through a service endpoint notification service (<xref:Microsoft.Xrm.Sdk.IServiceEndpointNotificationService>), to post the current request data context to the Azure Service Bus.
56+
An Azure-aware default (OOB) plug-in is available and can be registered with Dataverse by registering a service endpoint using the Plug-in Registration tool. You must register a plug-in 'step' in the event execution pipeline that identifies the message and table combination that triggers the plug-in to execute and perform the posting notification. When executed, the plug-in notifies the asynchronous service, through a service endpoint notification service (<xref:Microsoft.Xrm.Sdk.IServiceEndpointNotificationService>), to post the current request data context to the Azure Service Bus.
5657

57-
You can also write your own custom plug-in that is “Azure-aware”. The custom plug-in executes in partial trust mode in the sandbox. A custom plug-in can initiate posting of the data context to the service bus through the service endpoint notification service. Adding code to invoke this service makes the plug-in “Azure-aware”.
58+
You can also write your own custom plug-in that is “Azure-aware”. The custom plug-in executes in partial-trust mode in the sandbox. A custom plug-in can initiate posting of the data context to the service bus through the service endpoint notification service. Adding code to invoke this service makes the plug-in “Azure-aware”.
5859

5960
For more information about plug-ins in general, see [Writing a Plug-in](write-plug-in.md). For more information about Azure-aware plug-ins, see [Write a Custom Azure-aware Plug-in](write-custom-azure-aware-plugin.md).
6061

6162
### Custom workflow activities
6263

63-
Similarly to plug-ins, custom workflow activities can be written to initiate posting the current request message data context to the Azure Service Bus by using the service endpoint notification service. More information: [Workflow extensions](workflow/workflow-extensions.md)
64+
Similarly to plug-ins, custom workflow activities can be written to initiate posting the current request message data context to the Azure Service Bus by using the service endpoint notification service. More information: [Workflow extensions](workflow/workflow-extensions.md)
6465

6566
### Asynchronous service
6667

67-
Once notified by the service endpoint notification service, the asynchronous service handles posting the data context of the request message currently being processed by the event execution pipeline to the Azure Service Bus. Each post is performed by a system job of the asynchronous service. A user can view the status of each system job by using the **System Jobs** view of the Power Apps web application.
68+
Once notified by the service endpoint notification service, the asynchronous service handles posting the data context of the request message currently being processed by the event execution pipeline to the Azure Service Bus. Each post is performed by a system job of the asynchronous service. A user can view the status of each system job by using the **System Jobs** view of the Power Apps web application. In the web application, choose **Advanced settings** to display the legacy Dynamics 365 interface. Next, select **Settings** > **System jobs**.
6869

69-
For more information about the asynchronous service see [Asynchronous service](asynchronous-service.md).
70+
For more information about the asynchronous service, see [Asynchronous service](asynchronous-service.md).
7071

7172
### Microsoft Azure Service Bus
7273

73-
The service bus relays the request message data context between Dataverse and Azure Service Bus solution listener applications. The service bus also provides data security so that only authorized applications can access the posted Dynamics 365 data. Authorization of Dataverse to post the data context to the service bus and for listener applications to read it is managed by Azure Shared Access Signatures (SAS).
74+
The service bus relays the request message data context between Dataverse and Azure Service Bus solution listener applications. The service bus also provides data security so that only authorized applications can access the posted Dataverse data. Authorization of Dataverse to post the data context to the service bus and for listener applications to read it's managed by Azure Shared Access Signatures (SAS).
7475

7576
For more information about service bus, see [Service Bus](https://azure.microsoft.com/services/service-bus/). For more information about service bus authorization, see [Service Bus authentication and authorization](/azure/service-bus-messaging/service-bus-authentication-and-authorization).
7677

7778
### Microsoft Azure solution
7879

7980
For the Dataverse and Azure connection to work, there must be at least one solution in an Azure Service Bus solution account, where the solution contains one or more service endpoints. For a relay endpoint contract, a listener application that is “Dataverse-aware” must be actively listening on the endpoint for the Dataverse request on the Service Bus. For a queue endpoint contract, a listener doesn’t have to be actively listening. A listener is made Dataverse-aware by linking it to the <xref:Microsoft.Xrm.Sdk> assembly so that type <xref:Microsoft.Xrm.Sdk.RemoteExecutionContext> is defined. More information: [Write a Listener for a Microsoft Azure Solution](write-listener-application-azure-solution.md)
8081

81-
Dataverse supports sending event data to an Azure Event Hubs solution. More information about event hubs, see [Work with event data in your Azure Event Hub solution](work-event-data-azure-event-hub-solution.md).
82+
Dataverse supports sending event data to an Azure Event Hubs solution. More information about event hubs, see [Work with event data in your Azure Event Hubs solution](work-event-data-azure-event-hub-solution.md).
8283

8384
<a name="bkmk_describing"></a>
8485

@@ -92,7 +93,7 @@ The following diagram shows the physical elements that make up the scenario.
9293

9394
The sequence of events as identified in this diagram are as follows:
9495

95-
1. A listener application is registered on a Azure Service Bus solution endpoint, and begins actively listening for the Dataverse remote execution context on the Service Bus.
96+
1. A listener application is registered on an Azure Service Bus solution endpoint, and begins actively listening for the Dataverse remote execution context on the Service Bus.
9697

9798
2. A user performs some operation in Dataverse that triggers execution of the registered OOB plug-in or a custom Azure-aware plug-in. The plug-in initiates a post, through an asynchronous service system job, of the current request data context to the Service Bus.
9899
3. The claims posted by Dataverse are authenticated. The Service Bus then relays the remote execution context to the listener. The listener processes the context information and performs some business-related task with that information. The Service Bus notifies the asynchronous service of a successful post and sets the related system job to a completed status.
@@ -105,13 +106,13 @@ For each solution endpoint, you configure a contract that defines the handling o
105106

106107
### Queue
107108

108-
A queue contract provides a message queue in the cloud. With a queue contract, a listener doesn’t have to be actively listening for messages on the endpoint. For queues, there is a destructive read and a non-destructive read. A destructive read reads an available message from the queue and the message is removed. A non-destructive read doesn’t remove a message from the queue.
109+
A queue contract provides a message queue in the cloud. With a queue contract, a listener doesn’t have to be actively listening for messages on the endpoint. For queues, there's a destructive read and a nondestructive read. A destructive read reads an available message from the queue and the message is removed. A nondestructive read doesn’t remove a message from the queue.
109110

110111
The type of queue supported by Dataverse is called a persistent queue. Persistent queues have a long but finite message availability duration that can be specified in code.
111112

112113
### One-way
113114

114-
A one-way contract requires an active listener. If there is no active listener on an endpoint, the post to the Service Bus fails. Dataverse will retry the post in exponentially larger and larger time spans until the asynchronous system job that is posting the request is eventually aborted and its status is set to “Failed.”
115+
A one-way contract requires an active listener. If there's no active listener on an endpoint, the post to the Service Bus fails. Dataverse will retry the post in exponentially larger and larger time spans until the asynchronous system job that is posting the request is eventually aborted and its status is set to “Failed.”
115116

116117
### Two-way
117118

@@ -125,12 +126,9 @@ A REST contract is similar to a two-way contract on a REST endpoint.
125126

126127
Similar to a queue except that one or more listeners can subscribe to receive messages from the topic.
127128

128-
### Event Hub
129+
### Event Hubs
129130

130-
This contract type applies to Azure Event Hub solutions.
131-
132-
> [!IMPORTANT]
133-
> To use these contracts, you must write your listener applications using the [Azure SDK](https://www.windowsazure.com/develop/downloads/) v1.7 or later.
131+
This contract type applies to Azure Event Hubs solutions.
134132

135133
Identifying the kind of security a contract uses is part of the contract’s configuration. A contract can use Transport security, which uses Transport Layer Security (TLS) or Secure Sockets Layer (SSL) (https).
136134

@@ -142,5 +140,4 @@ Claims authentication is used for secure access to the Service Bus. The claim us
142140

143141
If an error occurred after a post was attempted to the Service Bus, check the status of the related system job in the web application for more information on the error. If the Service Bus is down or a listener/endpoint isn’t available, the current message being processed in Dataverse will not be posted to the bus. The asynchronous service will continue to try to post the message in an exponential pattern where it will try to post frequently at first and then at longer and longer intervals. For an internal Dataverse error, message posts are not attempted. For an external service bus or network error, the related system job will be in a “Wait” state.
144142

145-
146143
[!INCLUDE[footer-include](../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)