I have an Azure Function with an HttpTrigger.
I want to return 202 Accepted immediately to the caller and then actually process the call, which takes about a second.
Is there some best practice way of doing this?
I don't want to do ANYTHING before returning the call, so it is out of the question to first call EventGrid or similar.
Rejected options
Call EventGrid
By calling EventGrid I can return as soon as the EventGrid call is done and the actual processing can be in another function that is subscribing to the event. I don't want this because of the time it takes to call EventGrid and it does fail from time to time or take longer than normal.
Add to queue
By adding a message to a queue I can accomplish the same as with the EventGrid and it also has the same problem as described above.
Call a function without 'await'
I know that by calling a method inside my function without await, it will not wait for the response and I will be able to return immediately. However, my tests show that this is highly unrealiable, but please let me know if you think this is the way to go and why.
Custom threading
I can use Thread and ThreadStart etc. to make this manually and I guess this is what I might do if required, but I am asking this question to search for a better solution.