Reputation: 5717
Is the following scenario possible in azure?:
I need to build an app that will do some heavy processing behind based on user submission and return the results as a file to user.
Something like: after the user make's the call the service will respond: here is the url to your report come-back in 2 minutes ...
Upvotes: 0
Views: 1055
Reputation: 10998
Sure, this is possible. I can create lots of blob storage URLs right now --- http://account1.blob.core.windows.net/Reports/john1.pdf, http://account2.blob.core.windows.net/Reports/jane3.pdf, ...
I assume you know the storage account name, container, and final blob name that you want to use? If yes, just return that to the user in the form of a URL (you can use GetBlobReference in the Storage Client DLL to do this). You could even put up a temporary dummy report that says something like "Report not finished, check back later" in that blob, and then replace the blob once the report is done.
But may I suggest a better way? Change your Web API to by async. Your clients would submit the job and you would return an ID. The clients would then call another API to check the job status, and once the job was finished they would get back the URL. Look at the Azure Blob services's Copy Blob API (or any of the Azure Service Management APIs) as a point of reference.
Upvotes: 5