Worker roles only have a synchronous entry point. This means that you will need to keep the thread that the Run
method runs on active.
You can just call Wait
on the task that UploadFiles
gives you. Waiting is normally avoided but you are forced to do it here. The cost is not that high: One thread wasted.