I am trying to run my azure web jobs through c# code but it works but it's return accepted status with 202 status code.
I am using below code for the same code snippet for webjob api call from web app.
I am trying to run my azure web jobs through c# code but it works but it's return accepted status with 202 status code.
I am using below code for the same code snippet for webjob api call from web app.
Copyright © 2021 Jogjafile Inc.
It sounds like you may doubt that the HTTP response status code should be
200 OK
, not202 Accepted
if a HTTP requst have been handled successfully. However, either200 OK
or202 Accepted
is legal and reasonable, please refer to the 10 section10 Status Code Definitions
of W3C RFC-2616 to know them in depth, as below.Meanwhile, two code comments below from GitHub Kudu repo explain why used
202 Accepted
for triggering webjobs in here.I. Kudu.Services/ServiceHookHandlers/FetchHandler.cs#L111
II. Kudu.Services/Jobs/JobsController.cs#L191
It's up to the design intent of services.