Tuesday, September 15, 2020

Call Azure Function from Dynamics 365 via Plugin– Part 5.1

Previous Post - Call Azure Function using Console Application – Part 4

Note - This blog will not focus on plugin creation.

Pre-Requisite -  

i) Create an entity named "Test" with 2 columns as below.
ii) Create and register plugin on entity "create" event  

Plugin triggered on record creation will send the request to the Azure Function and the response will be updated on the source record.


Step 1 – Create a Class Library (.Net Framework) Project from your Visual Studio.

Add a class “StudentDetail” and data member “name”. This data member will contain the request from Target (Test Entity record).

Step 2 – Add a method “CallingAzureFunction” to “DemoClass”

Step 3 – Add below code to the “Execute” method of plugin named “DemoClass”.
    

Step 4 – Register Plugin on "create" event as below
    Step 
Note: As we have used external assembly "Newtonsoft.json", to register plugin assembly in Sandbox Mode will require DLL Merge.
 

Step 5 – After Successful registration of step, go to “Test" entity and create record.

Once record saved, response from Azure Function is updated in the "Response" field.

Lets have a look at Azure Function to understand the response updated in CRM.


Happy Learning, LET'S SHARE !

No comments:

Post a Comment

Popular Posts