You already know the answer! A Message Queue!
If you need more than a few KB for a message (maybe you want to pass a JPEG file) drop that into Blob Storage and signal the Web App/WebJob with a queue message indicating the full path to the newly arrived blob.
For more on implementing a Queue-centric workflow, see my other answer here:
https://stackoverflow.com/a/38036911/4148708
Sometimes, if keeping state isn't your first concern, it may be easier to implement a system where the WebJob calls an authenticated REST endpoint in the WebApp to GET/POST data.
There's no silver bullet. Every scenario tends to be a little different and may benefit from simplicity rather than durability (REST vs durable message queue).
Oh, and since you did specifically ask for async, here's one way to do it for REST (Queues are async by nature):
- Call the REST endpoint from your WebJob
- Return
202 Accepted
(as in I got you, but the TPS report isn't ready yet)
- Return
Location: https://webapp/{a-chunk-of-sha1-representing-a-unique-id}
(The point of this header is to tell the WebJob Check this URL from time to time to grab the finished TPS report)
- Follow the URL to get results,
200 OK
means you have them, 417 Expectation Failed
means not yet. Actually HTTP 417
is supposted to be used in response to 100 Continue
, but you never get to use that so i'm slowing campaigning for 417 Expectation Failed
to rival with buzzwords like elastic and disruptive. But i digress.