In previous tutorial we had created a webjob which can be run manually by click on Run in azure portal. But most of the cases we need to trigger this job when an event gets triggered. See the previous tutorial to create web jobs Create webjobs in .net core. I will use same web jobs here.
In this tutorial we will see how to call webjob from our web api call
Its a simple as we call any other services/api .
1. Go to azure portal -> appservice->webjob-> click on proprties .from right panel copy webhook ,username and password in you local .
Now open visual studio and create webapi project and paste below code
Now when you call the api above webjob will be triggered , in case of success we get response 202(accepted) code.
No comments:
Post a Comment
Thanks for your valuable comments