Unable To Read File From Blob Storage In Azure Function












0















I am trying to read a text file from Blob Storage using a Azure Function App. My goal is to read the file, which is a CSV, and reformat it into a new CSV with additional details added that isn't in the original CSV file.



I keep getting the following compilation error:



2018-11-28T00:22:34.125 [Error] run.csx(60,19): error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?) 


I can copy the Blob Storage section of the code into a Console Application's project and it will compile just fine.



Am I missing a reference?



This is the full function minus the connection string for the Blob Storage.



#r "Newtonsoft.Json"

#r "System.Configuration"
#r "System.Data"

#r "System.Collections"
#r "System.IO.Compression"
#r "System.Net"
#r "Microsoft.WindowsAzure.Storage"
#r "System.Linq"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

using System;
using System.Configuration;
using System.Text;
using System.IO;
using System.IO.Compression;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using System.Linq;
using System.Threading.Tasks;

public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");

string filePath = req.Query["filePath"];

string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
filePath = filePath ?? data?.filePath;

var fileInfo = GetFileInfo(filePath);

string line = "";

CloudStorageAccount storageAccount = CloudStorageAccount.Parse("Connection String goes Here");

CloudBlobClient client = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = client.GetContainerReference(fileInfo.Container);

var fileNameWithFolder =
fileInfo.DirectoryName == ""
? fileInfo.FileName
: $"{fileInfo.DirectoryName}/{fileInfo.FileName}";

CloudBlockBlob blockBlob2 = container.GetBlockBlobReference(fileNameWithFolder);

using (var memoryStream = new MemoryStream())
{
try
{
blockBlob2.DownloadToStream(memoryStream);
line = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray());
}
catch (Exception ex)
{
line = ex.Message;
}
}

return filePath != null
? (ActionResult)new OkObjectResult($"filePath: {filePath} Container: {fileInfo.Container} DirectoryName: {fileInfo.DirectoryName} FileName: {fileInfo.FileName}*********{line}")
: new BadRequestObjectResult("Please pass a filePath on the query string or in the request body");
}

private static FileInfo GetFileInfo(string filePath)
{
int index = filePath.IndexOf("/");
filePath = (index < 0)
? filePath
: filePath.Remove(index, 1);

var filePathSplit = filePath.Split('/');
var fileInfo = new FileInfo();
fileInfo.Container = filePathSplit[0];

if ((filePathSplit.Length - 2) > 0)
{
var folderName = "";

for(var i = 1; i < filePathSplit.Length - 1; i++)
{
if (folderName.Trim().Length > 0)
{
folderName += "/";
}

folderName += filePathSplit[i];
}

fileInfo.DirectoryName = folderName;
}

fileInfo.FileName = filePathSplit[filePathSplit.Length - 1];

return fileInfo;
}

public class FileInfo
{
public string Container { get; set; }
public string DirectoryName { get; set; }
public string FileName { get; set; }
}









share|improve this question



























    0















    I am trying to read a text file from Blob Storage using a Azure Function App. My goal is to read the file, which is a CSV, and reformat it into a new CSV with additional details added that isn't in the original CSV file.



    I keep getting the following compilation error:



    2018-11-28T00:22:34.125 [Error] run.csx(60,19): error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?) 


    I can copy the Blob Storage section of the code into a Console Application's project and it will compile just fine.



    Am I missing a reference?



    This is the full function minus the connection string for the Blob Storage.



    #r "Newtonsoft.Json"

    #r "System.Configuration"
    #r "System.Data"

    #r "System.Collections"
    #r "System.IO.Compression"
    #r "System.Net"
    #r "Microsoft.WindowsAzure.Storage"
    #r "System.Linq"

    using System.Net;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.Extensions.Primitives;
    using Newtonsoft.Json;

    using System;
    using System.Configuration;
    using System.Text;
    using System.IO;
    using System.IO.Compression;
    using System.Data.SqlClient;
    using System.Collections.Generic;
    using System.Data;
    using Microsoft.WindowsAzure.Storage;
    using Microsoft.WindowsAzure.Storage.Blob;
    using System.Linq;
    using System.Threading.Tasks;

    public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
    {
    log.LogInformation("C# HTTP trigger function processed a request.");

    string filePath = req.Query["filePath"];

    string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
    dynamic data = JsonConvert.DeserializeObject(requestBody);
    filePath = filePath ?? data?.filePath;

    var fileInfo = GetFileInfo(filePath);

    string line = "";

    CloudStorageAccount storageAccount = CloudStorageAccount.Parse("Connection String goes Here");

    CloudBlobClient client = storageAccount.CreateCloudBlobClient();
    CloudBlobContainer container = client.GetContainerReference(fileInfo.Container);

    var fileNameWithFolder =
    fileInfo.DirectoryName == ""
    ? fileInfo.FileName
    : $"{fileInfo.DirectoryName}/{fileInfo.FileName}";

    CloudBlockBlob blockBlob2 = container.GetBlockBlobReference(fileNameWithFolder);

    using (var memoryStream = new MemoryStream())
    {
    try
    {
    blockBlob2.DownloadToStream(memoryStream);
    line = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray());
    }
    catch (Exception ex)
    {
    line = ex.Message;
    }
    }

    return filePath != null
    ? (ActionResult)new OkObjectResult($"filePath: {filePath} Container: {fileInfo.Container} DirectoryName: {fileInfo.DirectoryName} FileName: {fileInfo.FileName}*********{line}")
    : new BadRequestObjectResult("Please pass a filePath on the query string or in the request body");
    }

    private static FileInfo GetFileInfo(string filePath)
    {
    int index = filePath.IndexOf("/");
    filePath = (index < 0)
    ? filePath
    : filePath.Remove(index, 1);

    var filePathSplit = filePath.Split('/');
    var fileInfo = new FileInfo();
    fileInfo.Container = filePathSplit[0];

    if ((filePathSplit.Length - 2) > 0)
    {
    var folderName = "";

    for(var i = 1; i < filePathSplit.Length - 1; i++)
    {
    if (folderName.Trim().Length > 0)
    {
    folderName += "/";
    }

    folderName += filePathSplit[i];
    }

    fileInfo.DirectoryName = folderName;
    }

    fileInfo.FileName = filePathSplit[filePathSplit.Length - 1];

    return fileInfo;
    }

    public class FileInfo
    {
    public string Container { get; set; }
    public string DirectoryName { get; set; }
    public string FileName { get; set; }
    }









    share|improve this question

























      0












      0








      0








      I am trying to read a text file from Blob Storage using a Azure Function App. My goal is to read the file, which is a CSV, and reformat it into a new CSV with additional details added that isn't in the original CSV file.



      I keep getting the following compilation error:



      2018-11-28T00:22:34.125 [Error] run.csx(60,19): error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?) 


      I can copy the Blob Storage section of the code into a Console Application's project and it will compile just fine.



      Am I missing a reference?



      This is the full function minus the connection string for the Blob Storage.



      #r "Newtonsoft.Json"

      #r "System.Configuration"
      #r "System.Data"

      #r "System.Collections"
      #r "System.IO.Compression"
      #r "System.Net"
      #r "Microsoft.WindowsAzure.Storage"
      #r "System.Linq"

      using System.Net;
      using Microsoft.AspNetCore.Mvc;
      using Microsoft.Extensions.Primitives;
      using Newtonsoft.Json;

      using System;
      using System.Configuration;
      using System.Text;
      using System.IO;
      using System.IO.Compression;
      using System.Data.SqlClient;
      using System.Collections.Generic;
      using System.Data;
      using Microsoft.WindowsAzure.Storage;
      using Microsoft.WindowsAzure.Storage.Blob;
      using System.Linq;
      using System.Threading.Tasks;

      public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
      {
      log.LogInformation("C# HTTP trigger function processed a request.");

      string filePath = req.Query["filePath"];

      string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
      dynamic data = JsonConvert.DeserializeObject(requestBody);
      filePath = filePath ?? data?.filePath;

      var fileInfo = GetFileInfo(filePath);

      string line = "";

      CloudStorageAccount storageAccount = CloudStorageAccount.Parse("Connection String goes Here");

      CloudBlobClient client = storageAccount.CreateCloudBlobClient();
      CloudBlobContainer container = client.GetContainerReference(fileInfo.Container);

      var fileNameWithFolder =
      fileInfo.DirectoryName == ""
      ? fileInfo.FileName
      : $"{fileInfo.DirectoryName}/{fileInfo.FileName}";

      CloudBlockBlob blockBlob2 = container.GetBlockBlobReference(fileNameWithFolder);

      using (var memoryStream = new MemoryStream())
      {
      try
      {
      blockBlob2.DownloadToStream(memoryStream);
      line = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray());
      }
      catch (Exception ex)
      {
      line = ex.Message;
      }
      }

      return filePath != null
      ? (ActionResult)new OkObjectResult($"filePath: {filePath} Container: {fileInfo.Container} DirectoryName: {fileInfo.DirectoryName} FileName: {fileInfo.FileName}*********{line}")
      : new BadRequestObjectResult("Please pass a filePath on the query string or in the request body");
      }

      private static FileInfo GetFileInfo(string filePath)
      {
      int index = filePath.IndexOf("/");
      filePath = (index < 0)
      ? filePath
      : filePath.Remove(index, 1);

      var filePathSplit = filePath.Split('/');
      var fileInfo = new FileInfo();
      fileInfo.Container = filePathSplit[0];

      if ((filePathSplit.Length - 2) > 0)
      {
      var folderName = "";

      for(var i = 1; i < filePathSplit.Length - 1; i++)
      {
      if (folderName.Trim().Length > 0)
      {
      folderName += "/";
      }

      folderName += filePathSplit[i];
      }

      fileInfo.DirectoryName = folderName;
      }

      fileInfo.FileName = filePathSplit[filePathSplit.Length - 1];

      return fileInfo;
      }

      public class FileInfo
      {
      public string Container { get; set; }
      public string DirectoryName { get; set; }
      public string FileName { get; set; }
      }









      share|improve this question














      I am trying to read a text file from Blob Storage using a Azure Function App. My goal is to read the file, which is a CSV, and reformat it into a new CSV with additional details added that isn't in the original CSV file.



      I keep getting the following compilation error:



      2018-11-28T00:22:34.125 [Error] run.csx(60,19): error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?) 


      I can copy the Blob Storage section of the code into a Console Application's project and it will compile just fine.



      Am I missing a reference?



      This is the full function minus the connection string for the Blob Storage.



      #r "Newtonsoft.Json"

      #r "System.Configuration"
      #r "System.Data"

      #r "System.Collections"
      #r "System.IO.Compression"
      #r "System.Net"
      #r "Microsoft.WindowsAzure.Storage"
      #r "System.Linq"

      using System.Net;
      using Microsoft.AspNetCore.Mvc;
      using Microsoft.Extensions.Primitives;
      using Newtonsoft.Json;

      using System;
      using System.Configuration;
      using System.Text;
      using System.IO;
      using System.IO.Compression;
      using System.Data.SqlClient;
      using System.Collections.Generic;
      using System.Data;
      using Microsoft.WindowsAzure.Storage;
      using Microsoft.WindowsAzure.Storage.Blob;
      using System.Linq;
      using System.Threading.Tasks;

      public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
      {
      log.LogInformation("C# HTTP trigger function processed a request.");

      string filePath = req.Query["filePath"];

      string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
      dynamic data = JsonConvert.DeserializeObject(requestBody);
      filePath = filePath ?? data?.filePath;

      var fileInfo = GetFileInfo(filePath);

      string line = "";

      CloudStorageAccount storageAccount = CloudStorageAccount.Parse("Connection String goes Here");

      CloudBlobClient client = storageAccount.CreateCloudBlobClient();
      CloudBlobContainer container = client.GetContainerReference(fileInfo.Container);

      var fileNameWithFolder =
      fileInfo.DirectoryName == ""
      ? fileInfo.FileName
      : $"{fileInfo.DirectoryName}/{fileInfo.FileName}";

      CloudBlockBlob blockBlob2 = container.GetBlockBlobReference(fileNameWithFolder);

      using (var memoryStream = new MemoryStream())
      {
      try
      {
      blockBlob2.DownloadToStream(memoryStream);
      line = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray());
      }
      catch (Exception ex)
      {
      line = ex.Message;
      }
      }

      return filePath != null
      ? (ActionResult)new OkObjectResult($"filePath: {filePath} Container: {fileInfo.Container} DirectoryName: {fileInfo.DirectoryName} FileName: {fileInfo.FileName}*********{line}")
      : new BadRequestObjectResult("Please pass a filePath on the query string or in the request body");
      }

      private static FileInfo GetFileInfo(string filePath)
      {
      int index = filePath.IndexOf("/");
      filePath = (index < 0)
      ? filePath
      : filePath.Remove(index, 1);

      var filePathSplit = filePath.Split('/');
      var fileInfo = new FileInfo();
      fileInfo.Container = filePathSplit[0];

      if ((filePathSplit.Length - 2) > 0)
      {
      var folderName = "";

      for(var i = 1; i < filePathSplit.Length - 1; i++)
      {
      if (folderName.Trim().Length > 0)
      {
      folderName += "/";
      }

      folderName += filePathSplit[i];
      }

      fileInfo.DirectoryName = folderName;
      }

      fileInfo.FileName = filePathSplit[filePathSplit.Length - 1];

      return fileInfo;
      }

      public class FileInfo
      {
      public string Container { get; set; }
      public string DirectoryName { get; set; }
      public string FileName { get; set; }
      }






      c# .net azure azure-functions azure-storage-blobs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 28 '18 at 0:28









      JaredJared

      479




      479
























          2 Answers
          2






          active

          oldest

          votes


















          1














          V2 function is based on .Net Core env hence it references Microsoft.WindowsAzure.Storage assembly depending on .Net Standard, which has no synchronous API, it means we need *Async method.



          await blockBlob2.DownloadToStreamAsync(memoryStream);





          share|improve this answer
























          • Thank you Jerry Liu. That worked!

            – Jared
            Nov 28 '18 at 14:24



















          0














          According to your code and error message, you did not use the method DownloadToStream correctly. For more details, please refer to the document.



                 CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
          var blobRequestOptions = new BlobRequestOptions
          {
          ServerTimeout = TimeSpan.FromSeconds(30),
          MaximumExecutionTime = TimeSpan.FromSeconds(120),
          RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), maxRetryCount),
          };

          using (var memoryStream = new MemoryStream())
          {
          blockBlob.DownloadToStream(memoryStream, null, blobRequestOptions);
          }





          share|improve this answer
























          • Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

            – Jared
            Nov 28 '18 at 14:23











          • Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

            – Jared
            Nov 28 '18 at 14:25











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53510321%2funable-to-read-file-from-blob-storage-in-azure-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          V2 function is based on .Net Core env hence it references Microsoft.WindowsAzure.Storage assembly depending on .Net Standard, which has no synchronous API, it means we need *Async method.



          await blockBlob2.DownloadToStreamAsync(memoryStream);





          share|improve this answer
























          • Thank you Jerry Liu. That worked!

            – Jared
            Nov 28 '18 at 14:24
















          1














          V2 function is based on .Net Core env hence it references Microsoft.WindowsAzure.Storage assembly depending on .Net Standard, which has no synchronous API, it means we need *Async method.



          await blockBlob2.DownloadToStreamAsync(memoryStream);





          share|improve this answer
























          • Thank you Jerry Liu. That worked!

            – Jared
            Nov 28 '18 at 14:24














          1












          1








          1







          V2 function is based on .Net Core env hence it references Microsoft.WindowsAzure.Storage assembly depending on .Net Standard, which has no synchronous API, it means we need *Async method.



          await blockBlob2.DownloadToStreamAsync(memoryStream);





          share|improve this answer













          V2 function is based on .Net Core env hence it references Microsoft.WindowsAzure.Storage assembly depending on .Net Standard, which has no synchronous API, it means we need *Async method.



          await blockBlob2.DownloadToStreamAsync(memoryStream);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 '18 at 1:24









          Jerry LiuJerry Liu

          11.4k11233




          11.4k11233













          • Thank you Jerry Liu. That worked!

            – Jared
            Nov 28 '18 at 14:24



















          • Thank you Jerry Liu. That worked!

            – Jared
            Nov 28 '18 at 14:24

















          Thank you Jerry Liu. That worked!

          – Jared
          Nov 28 '18 at 14:24





          Thank you Jerry Liu. That worked!

          – Jared
          Nov 28 '18 at 14:24













          0














          According to your code and error message, you did not use the method DownloadToStream correctly. For more details, please refer to the document.



                 CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
          var blobRequestOptions = new BlobRequestOptions
          {
          ServerTimeout = TimeSpan.FromSeconds(30),
          MaximumExecutionTime = TimeSpan.FromSeconds(120),
          RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), maxRetryCount),
          };

          using (var memoryStream = new MemoryStream())
          {
          blockBlob.DownloadToStream(memoryStream, null, blobRequestOptions);
          }





          share|improve this answer
























          • Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

            – Jared
            Nov 28 '18 at 14:23











          • Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

            – Jared
            Nov 28 '18 at 14:25
















          0














          According to your code and error message, you did not use the method DownloadToStream correctly. For more details, please refer to the document.



                 CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
          var blobRequestOptions = new BlobRequestOptions
          {
          ServerTimeout = TimeSpan.FromSeconds(30),
          MaximumExecutionTime = TimeSpan.FromSeconds(120),
          RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), maxRetryCount),
          };

          using (var memoryStream = new MemoryStream())
          {
          blockBlob.DownloadToStream(memoryStream, null, blobRequestOptions);
          }





          share|improve this answer
























          • Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

            – Jared
            Nov 28 '18 at 14:23











          • Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

            – Jared
            Nov 28 '18 at 14:25














          0












          0








          0







          According to your code and error message, you did not use the method DownloadToStream correctly. For more details, please refer to the document.



                 CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
          var blobRequestOptions = new BlobRequestOptions
          {
          ServerTimeout = TimeSpan.FromSeconds(30),
          MaximumExecutionTime = TimeSpan.FromSeconds(120),
          RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), maxRetryCount),
          };

          using (var memoryStream = new MemoryStream())
          {
          blockBlob.DownloadToStream(memoryStream, null, blobRequestOptions);
          }





          share|improve this answer













          According to your code and error message, you did not use the method DownloadToStream correctly. For more details, please refer to the document.



                 CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
          var blobRequestOptions = new BlobRequestOptions
          {
          ServerTimeout = TimeSpan.FromSeconds(30),
          MaximumExecutionTime = TimeSpan.FromSeconds(120),
          RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), maxRetryCount),
          };

          using (var memoryStream = new MemoryStream())
          {
          blockBlob.DownloadToStream(memoryStream, null, blobRequestOptions);
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 '18 at 1:11









          JimJim

          1855




          1855













          • Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

            – Jared
            Nov 28 '18 at 14:23











          • Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

            – Jared
            Nov 28 '18 at 14:25



















          • Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

            – Jared
            Nov 28 '18 at 14:23











          • Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

            – Jared
            Nov 28 '18 at 14:25

















          Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

          – Jared
          Nov 28 '18 at 14:23





          Thank you Jim for the suggestion. I tried it and still getting this error. [error CS1061: 'CloudBlockBlob' does not contain a definition for 'DownloadToStream' and no extension method 'DownloadToStream' accepting a first argument of type 'CloudBlockBlob' could be found (are you missing a using directive or an assembly reference?)]

          – Jared
          Nov 28 '18 at 14:23













          Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

          – Jared
          Nov 28 '18 at 14:25





          Jerry Liu's suggestion worked. But thank you Jim for providing a suggestion to try.

          – Jared
          Nov 28 '18 at 14:25


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53510321%2funable-to-read-file-from-blob-storage-in-azure-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)