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 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-5 | at 9:30 AM every weekday |
0 30 9 * Jan Mon | at 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
Nice
ReplyDelete