Implement Push Changes from Dynamics CRM to Other Source Systems Using WebJobs

When we think about integrating Dynamics CRM with other source systems, we can discover there are lots of ways to do it. Today, we will cover one architecture design that we can implement if we want to push the changes from CRM to other source systems. 

Design Architecture

From the image above, we will use Azure Service Bus to create an endpoint in CRM. Then we will register several plugin steps (Create, Update, and Delete in Account‘s table). Then to process the changes, we will create a WebJob that will listen to the Service Bus Queue, and process the message. But because this is only a demonstration, I will simply log the message to the console (in the real implementation, you need to process the message to save the changes).

Create Service Bus

Go to portal.azure.com > Service Bus > click Create button. Then you can create a new Resource Group / Select an existing Resource Group, give a Name to the Service Bus Namespace, select Location and select the Pricing Tier. For the demonstration purpose, I will select the Basic pricing tier and you can click the Review + Create button.

Create Service Bus

Once the Service Bus is created, you can open it. Then go to Queues blade. Here you can click the + Queue button and fill the form like below:

Create crm-out queue

The last part is to get the connection string of the Service Bus. You just need to click the Shared access policies blade > select RootManageSharedAccessKey. Then you can copy the Primary Connection String and save the value for later use.

Copy the Primary Connection String for later use

Register CRM Endpoint

The next step is to create a new endpoint from the CRM. Open your plugin registration tool > click the Register button > select Register New Service Endpoint.

Create Service Endpoint

Paste the Primary Connection String from the previous step > give the Queue name as crm-out (must be the same as the queue name you created before). Then I’ll use JSON message format. All the properties you can follow this screenshot:

Service Endpoint Registration

Once you have done it, you can click save.

The last part is to register the new plugin steps under the new Service Endpoint we create before. You can create the plugin steps for Account‘s Create, Update, and Delete message (I put all the plugin steps on the Async Execution Mode).

With this, the setup from CRM is done.

Create WebJob

Now you can open your Visual Studio > create a new console app (.NET Core 3.1). Then you can download all these NuGet packages:

<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.WebJobs.Core" Version="3.0.31" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="4.0.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.2.0" />
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="Settings.job">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
</Project>

For the Program.cs here is the code:

using Microsoft.Extensions.Hosting;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace WebjobCrm
{
    internal class Program
    {
        static async Task Main()
        {
            var builder = new HostBuilder();
            builder.ConfigureLogging((context, b) =>
            {
                b.AddConsole();
            });
            builder.ConfigureWebJobs(b =>
            {
                b.AddAzureStorageCoreServices();
                b.AddServiceBus();
            });

            var host = builder.Build();
            using (host)
            {
                await host.RunAsync();
            }
        }
    }
}

For the Function.cs here is the code:

using Microsoft.Extensions.Logging;
using Microsoft.Azure.WebJobs;

namespace WebjobCrm
{
    public class Functions
    {
        public static void ProcessCrmQueue([ServiceBusTrigger("crm-out", 
            Connection = "ServiceBusConnection")]string message, ILogger logger)
        {
            // Todo: Process the message to save the changes to other source systems
            logger.LogInformation(message);
        }
    }
}

Once you have done that, the last part is to publish it to our Azure environment. Right-click on the project > Publish > create new Profile > login to your Azure account > create new App Service:

Create App Service

For the WebJob Type, change it to Continous > click Save.

Profile Settings

Then you can Publish it and wait until the WebJob is deployed to your Azure App Service.

The last part is to create the AppSettings in the Azure App Service. Go to your portal.azure.com from your browser > go to the new App ServiceConfiguration blade > click the + New Application setting > named it as ServiceBusConnection (must be the same as the code) > for the value, paste the Primary Connection String that you can get from the previous step.

Application Settings

Here is the sample message that we are getting from the logger for Create Scenario:

{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"65bb29e9-130a-4ead-a00d-41bc2645dfc7","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"Entity:http://schemas.microsoft.com/xrm/2011/Contracts","Attributes":[{"key":"territorycode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"statecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":0}},{"key":"address2_shippingmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"isprivate","value":false},{"key":"followemail","value":true},{"key":"donotbulkemail","value":false},{"key":"donotsendmm","value":false},{"key":"createdon","value":"/Date(1642179388000)/"},{"key":"businesstypecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"donotpostalmail","value":false},{"key":"ownerid","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2d566234-ef37-ec11-b6e6-00224824c3aa","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"donotbulkpostalmail","value":false},{"key":"name","value":"Temmy Create"},{"key":"donotemail","value":false},{"key":"address2_addresstypecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"donotphone","value":false},{"key":"transactioncurrencyid","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"94c29e11-a335-ec11-b6e6-000d3a1eef0e","KeyAttributes":[],"LogicalName":"transactioncurrency","Name":null,"RowVersion":null}},{"key":"modifiedby","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2d566234-ef37-ec11-b6e6-00224824c3aa","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"statuscode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"modifiedonbehalfby","value":null},{"key":"preferredcontactmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"owningbusinessunit","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","KeyAttributes":[],"LogicalName":"businessunit","Name":null,"RowVersion":null}},{"key":"accountid","value":"865516ea-5a75-ec11-8943-000d3a8e7c45"},{"key":"createdby","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2d566234-ef37-ec11-b6e6-00224824c3aa","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"donotfax","value":false},{"key":"merged","value":false},{"key":"customersizecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"marketingonly","value":false},{"key":"accountratingcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"shippingmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"processid","value":"00000000-0000-0000-0000-000000000000"},{"key":"creditonhold","value":false},{"key":"modifiedon","value":"/Date(1642179388000)/"},{"key":"participatesinworkflow","value":false},{"key":"accountclassificationcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"address2_freighttermscode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"exchangerate","value":1.0}],"EntityState":null,"FormattedValues":[{"key":"territorycode","value":"Default Value"},{"key":"statecode","value":"Active"},{"key":"address2_shippingmethodcode","value":"Default Value"},{"key":"isprivate","value":"No"},{"key":"followemail","value":"Allow"},{"key":"donotbulkemail","value":"Allow"},{"key":"donotsendmm","value":"Send"},{"key":"createdon","value":"2022-01-14T23:56:28+07:00"},{"key":"businesstypecode","value":"Default Value"},{"key":"donotpostalmail","value":"Allow"},{"key":"donotbulkpostalmail","value":"No"},{"key":"donotemail","value":"Allow"},{"key":"address2_addresstypecode","value":"Default Value"},{"key":"donotphone","value":"Allow"},{"key":"statuscode","value":"Active"},{"key":"preferredcontactmethodcode","value":"Any"},{"key":"donotfax","value":"Allow"},{"key":"merged","value":"No"},{"key":"customersizecode","value":"Default Value"},{"key":"marketingonly","value":"No"},{"key":"accountratingcode","value":"Default Value"},{"key":"shippingmethodcode","value":"Default Value"},{"key":"creditonhold","value":"No"},{"key":"modifiedon","value":"2022-01-14T23:56:28+07:00"},{"key":"participatesinworkflow","value":"No"},{"key":"accountclassificationcode","value":"Default Value"},{"key":"address2_freighttermscode","value":"Default Value"}],"Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":"3848265"}}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Create","Mode":1,"OperationCreatedOn":"/Date(1642179389000+0000)/","OperationId":"8b5516ea-5a75-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[{"key":"id","value":"865516ea-5a75-ec11-8943-000d3a8e7c45"}],"OwningExtension":{"Id":"7523ddbe-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"65bb29e9-130a-4ead-a00d-41bc2645dfc7","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"Entity:http://schemas.microsoft.com/xrm/2011/Contracts","Attributes":[{"key":"name","value":"Temmy Create"},{"key":"creditonhold","value":false},{"key":"donotpostalmail","value":false},{"key":"donotfax","value":false},{"key":"donotphone","value":false},{"key":"donotbulkemail","value":false},{"key":"followemail","value":true},{"key":"donotemail","value":false},{"key":"preferredcontactmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"donotsendmm","value":false},{"key":"statuscode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"marketingonly","value":false},{"key":"processid","value":"00000000-0000-0000-0000-000000000000"},{"key":"transactioncurrencyid","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"94c29e11-a335-ec11-b6e6-000d3a1eef0e","KeyAttributes":[],"LogicalName":"transactioncurrency","Name":null,"RowVersion":null}},{"key":"ownerid","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2d566234-ef37-ec11-b6e6-00224824c3aa","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"customersizecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"accountratingcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"businesstypecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"shippingmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"address2_shippingmethodcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"territorycode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"accountclassificationcode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"donotbulkpostalmail","value":false},{"key":"address2_freighttermscode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"isprivate","value":false},{"key":"address2_addresstypecode","value":{"__type":"OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts","Value":1}},{"key":"merged","value":false},{"key":"participatesinworkflow","value":false},{"key":"accountid","value":"865516ea-5a75-ec11-8943-000d3a8e7c45"}],"EntityState":null,"FormattedValues":[],"Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":null}},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"SuppressDuplicateDetection","value":false}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Create","Mode":1,"OperationCreatedOn":"/Date(1642179389000+0000)/","OperationId":"8b5516ea-5a75-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[],"OwningExtension":{"Id":"7523ddbe-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":null,"PostEntityImages":[],"PreEntityImages":[],"PrimaryEntityId":"865516ea-5a75-ec11-8943-000d3a8e7c45","PrimaryEntityName":"account","RequestId":"b904a825-74eb-4bc1-8565-073a75c636bc","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"DefaultsAddedFlag","value":true},{"key":"ChangedEntityTypes","value":[{"__type":"KeyValuePairOfstringstring:#System.Collections.Generic","key":"account","value":"Update"}]}],"Stage":30,"UserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","UserId":"2d566234-ef37-ec11-b6e6-00224824c3aa"},"PostEntityImages":[{"key":"AsynchronousStepPrimaryName","value":{"Attributes":[{"key":"name","value":"Temmy Create"},{"key":"accountid","value":"865516ea-5a75-ec11-8943-000d3a8e7c45"}],"EntityState":null,"FormattedValues":[],"Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":null}}],"PreEntityImages":[],"PrimaryEntityId":"865516ea-5a75-ec11-8943-000d3a8e7c45","PrimaryEntityName":"account","RequestId":"b904a825-74eb-4bc1-8565-073a75c636bc","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"DefaultsAddedFlag","value":true}],"Stage":40,"UserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","UserId":"2d566234-ef37-ec11-b6e6-00224824c3aa"}

For Update Scenario:

{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"62488cc1-bf57-4aca-9336-0ed6c5a8d402","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"Entity:http://schemas.microsoft.com/xrm/2011/Contracts","Attributes":[{"key":"websiteurl","value":"https://temmyraharjo.wordpress.com"},{"key":"accountid","value":"f2bb74d4-9c6f-ec11-8943-00224829ca49"},{"key":"modifiedon","value":"/Date(1642170985000)/"},{"key":"modifiedby","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"2d566234-ef37-ec11-b6e6-00224824c3aa","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"modifiedonbehalfby","value":null}],"EntityState":null,"FormattedValues":[],"Id":"f2bb74d4-9c6f-ec11-8943-00224829ca49","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":"3848238"}}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Update","Mode":1,"OperationCreatedOn":"/Date(1642170985000+0000)/","OperationId":"c922aa56-4775-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[],"OwningExtension":{"Id":"efedcedc-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"62488cc1-bf57-4aca-9336-0ed6c5a8d402","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"Entity:http://schemas.microsoft.com/xrm/2011/Contracts","Attributes":[{"key":"websiteurl","value":"https://temmyraharjo.wordpress.com"},{"key":"accountid","value":"f2bb74d4-9c6f-ec11-8943-00224829ca49"}],"EntityState":null,"FormattedValues":[],"Id":"f2bb74d4-9c6f-ec11-8943-00224829ca49","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":null}},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"SuppressDuplicateDetection","value":false}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Update","Mode":1,"OperationCreatedOn":"/Date(1642170985000+0000)/","OperationId":"c922aa56-4775-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[],"OwningExtension":{"Id":"efedcedc-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":null,"PostEntityImages":[],"PreEntityImages":[],"PrimaryEntityId":"f2bb74d4-9c6f-ec11-8943-00224829ca49","PrimaryEntityName":"account","RequestId":"cbfc3c41-b56e-4d38-bf1b-1b497838c7a4","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"ChangedEntityTypes","value":[{"__type":"KeyValuePairOfstringstring:#System.Collections.Generic","key":"account","value":"Update"}]}],"Stage":30,"UserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","UserId":"2d566234-ef37-ec11-b6e6-00224824c3aa"},"PostEntityImages":[{"key":"AsynchronousStepPrimaryName","value":{"Attributes":[{"key":"name","value":"Account 1 Temmy"},{"key":"accountid","value":"f2bb74d4-9c6f-ec11-8943-00224829ca49"}],"EntityState":null,"FormattedValues":[],"Id":"f2bb74d4-9c6f-ec11-8943-00224829ca49","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":null}}],"PreEntityImages":[],"PrimaryEntityId":"f2bb74d4-9c6f-ec11-8943-00224829ca49","PrimaryEntityName":"account","RequestId":"cbfc3c41-b56e-4d38-bf1b-1b497838c7a4","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"}],"Stage":40,"UserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","UserId":"2d566234-ef37-ec11-b6e6-00224824c3aa"}

For Delete Scenario:

{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"b0633c1a-562c-4391-94ad-0257fda6c0c4","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","Name":null,"RowVersion":null}}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Delete","Mode":1,"OperationCreatedOn":"/Date(1642179748000+0000)/","OperationId":"e2f5abbe-5b75-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[],"OwningExtension":{"Id":"42eb99f8-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":{"BusinessUnitId":"2a96d5db-6735-ec11-b6e6-000d3a1eef0e","CorrelationId":"b0633c1a-562c-4391-94ad-0257fda6c0c4","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"4e8a594f-68a6-4ad8-be7c-771ed0f9e657","InitiatingUserId":"2d566234-ef37-ec11-b6e6-00224824c3aa","InputParameters":[{"key":"Target","value":{"__type":"EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts","Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","Name":null,"RowVersion":null}},{"key":"x-ms-app-name","value":"cra32_BlogApp"}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Delete","Mode":1,"OperationCreatedOn":"/Date(1642179748000+0000)/","OperationId":"e2f5abbe-5b75-ec11-8943-000d3a8e7c45","OrganizationId":"89d32dcc-ac01-4071-8781-a51181284514","OrganizationName":"unq89d32dccac0140718781a51181284","OutputParameters":[],"OwningExtension":{"Id":"42eb99f8-fa74-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":null,"PostEntityImages":[],"PreEntityImages":[],"PrimaryEntityId":"865516ea-5a75-ec11-8943-000d3a8e7c45","PrimaryEntityName":"account","RequestId":"3d138f31-327b-4310-9512-0391a79fc815","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"},{"key":"ChangedEntityTypes","value":[{"__type":"KeyValuePairOfstringstring:#System.Collections.Generic","key":"account","value":"Update"}]}],"Stage":30,"UserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","UserId":"74e5796d-aa51-4e29-ad1e-8ff2322ff994"},"PostEntityImages":[],"PreEntityImages":[{"key":"AsynchronousStepPrimaryName","value":{"Attributes":[{"key":"name","value":"Temmy Create"},{"key":"accountid","value":"865516ea-5a75-ec11-8943-000d3a8e7c45"}],"EntityState":null,"FormattedValues":[],"Id":"865516ea-5a75-ec11-8943-000d3a8e7c45","KeyAttributes":[],"LogicalName":"account","RelatedEntities":[],"RowVersion":null}}],"PrimaryEntityId":"865516ea-5a75-ec11-8943-000d3a8e7c45","PrimaryEntityName":"account","RequestId":"3d138f31-327b-4310-9512-0391a79fc815","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"cra32_BlogApp"}],"Stage":40,"UserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","UserId":"74e5796d-aa51-4e29-ad1e-8ff2322ff994"}

Below is the sample of the WebJobs log when processing the Queue Message:

WebJob running

Happy CRM-ing!

One thought on “Implement Push Changes from Dynamics CRM to Other Source Systems Using WebJobs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.