I want to download file from some third party server and wanted to store inside Azure Storage. But I want to perform this process using Azure function. Below are the steps I want to achieve.
- Create Azure(HTTP trigger enable)function what will be executed by third party server using WebHook.
- Download file content using download URL given by Webhook using "Webclient" in C#.
Store file content into Azure Storage directly.
Task.Run(() => { using (var webClient = new WebClient()) { webClient.Headers.Add(HttpRequestHeader.Authorization, string.Format("Bearer {0}", {download token})); webClient.Headers.Add(HttpRequestHeader.ContentType, "application/json"); webClient.DownloadFileAsync("https://www.server.com/file1.mp4", {Here I want to store file into Azure Storage}); } });