Dynamics365CustomBinding 1.0.6

dotnet add package Dynamics365CustomBinding --version 1.0.6                
NuGet\Install-Package Dynamics365CustomBinding -Version 1.0.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dynamics365CustomBinding" Version="1.0.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dynamics365CustomBinding --version 1.0.6                
#r "nuget: Dynamics365CustomBinding, 1.0.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Dynamics365CustomBinding as a Cake Addin
#addin nuget:?package=Dynamics365CustomBinding&version=1.0.6

// Install Dynamics365CustomBinding as a Cake Tool
#tool nuget:?package=Dynamics365CustomBinding&version=1.0.6                

Dynamics 365 Binding

A custom binding for Dynamics 365 inside Azure function

Features

  • Output binding for multiple Dynamics 365 Organization Requests
  • Input / output binding for Dynamcis 365 Service Client

Dependencies

  • .Net 6.x
  • Microsoft.Azure.WebJob 3.0.33+
  • Microsoft.Azure.WebJob.Core 3.0.33+
  • Microsoft.PowerPlatform.Dataverse.Client 1.0.4+

Installation

Install the package and all dependencies.

PM> Install-Package Dynamics365CustomBinding -version <latest_version>

Samples

Dynamics 365 Binding can be used as in following ways

Output Binding Usage

If all you need is just to send some commands to Dyancmis 365 and not care about their retuns or futhre actions, Dyanmics 365 Output Binding can be used as below

[FunctionName("<your_function_name>")]
public static async Task<string> <your_function_name>(<your_function_trigger>,
[Dynamics365Output("%<your_dynamics_365_connection_string>%", ContinueOnError = false)] IAsyncCollector<OrganizationRequest> requests, 
ILogger log)
{
    log.LogInformation($"Function triggered");
    
    Microsoft.Xrm.Sdk.Entity bpi= new Microsoft.Xrm.Sdk.Entity("account");
    bpi["name"] = "Test User";
    CreateRequest req = new CreateRequest();
    req.Target = bpi;
        
    await requests.AddAsync(req);
    return "done!";
}

The sample above shows a CreateRequest, and you can do any requests derived from OrganizationRequest. As for connection string, please refer to https://docs.microsoft.com/en-us/powerapps/developer/data-platform/xrm-tooling/use-connection-strings-xrm-tooling-connect. In particular, if you are using service account, please following OAuth section; if you are using client secret please follow Client Secret section.

Input / output Binding Usage

If all you need more complicated stuff than just to send some commands to Dyancmis 365, Dyanmics 365 Input / Output Binding can be used as below

[FunctionName("<your_function_name>")]
public static string ProcessSubpoenaWorker(<your_function_trigger>,
[Dynamics365Client("%<your_dynamics_365_connection_string>%")] ServiceClient client,
ILogger log)
{
    log.LogInformation($"Function triggered");
    using(client) {
        // your actions with Dynamics 365
    }
    return "done!";
}

For Dynamics 365 connection string, please refer to the previous section for more details. For how to user ServiceClient, please refer to https://www.nuget.org/packages/Microsoft.PowerPlatform.Dataverse.Client/

License

Free software, absolutely no warranty, use at your own risk!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 447 7/8/2022
1.0.5 430 4/29/2022
1.0.4 564 3/21/2022

Updated nuget package version & added comments