Creating A schedule Azure function to Create a record From Console application using Visual Studio 2019

 Creating A schedule Azure function to Create a record From Console application using Visual Studio 2019


For this you already have azure account with Crm instance and register the Crm for the wep api

After that Create a project with azure function and select the trigger point as Time Trigger and it will create the default function with every 5 min schedule trigger.


After that, it will create the new default function like below


After Adding the function we need to add the some DLL to the project show below from SDK file

using Microsoft.Xrm.Tooling.Connector;

using Microsoft.Xrm.Sdk;

After adding the dll to proejct then we can add some neecessart code to connect to Crm

We need to change the trigger for this function 

Time trigger contains 6 Start Each star have his own definition

{second} {minute} {hour} {day} {month} {day-of-week}

    *       *        *     *      *          *   

Day of week means like Sunday to Saturday

month means like Jan to dec

0 */5 * * * *once every five minutes
0 0 * * * *once at the top of every hour
0 0 */2 * * *once every two hours
0 0 9-17 * * *once every hour from 9 AM to 5 PM
0 30 9 * * *at 9:30 AM every day
0 30 9 * * 1-5at 9:30 AM every weekday
0 30 9 * Jan Monat 9:30 AM every Monday in January

 this is for the timer trigger


I am testing my function for every 1min to create the record.


Above picture my function was triggered for every 1 min from 18:25 to 18:31

 it created 7 records to crm instance 



Thanks for reading my post and Follow me for the latest posts

Comments

Post a Comment

Popular posts from this blog

create HTML page show all contact related to specific account, add this webresource as a subgrid in the form

Connect MS Crm To Postman For Webapi Calls.

create one PCF control and embed into crm