title: Extract embedded files from azure blob in c#
body: <p>I have embedded pdf files stored inside a blob file.I want to extract those file from my blob.</p>
  <p>below are the thing I have done so far:</p>
  <ol>
  <li>I have made http trigger function app</li>
  <li>establish connection with the storage container</li>
  <li>able to fetch the blob.</li>
  </ol>
  <p>get the embedded file I am using following code:</p>
  <pre><code>namespace PDFDownloader {
    public static class Function1 { [FunctionName(&quot;Function1&quot;)]
      public static async Task &lt;IActionResult&gt; Run([HttpTrigger(AuthorizationLevel.Function, &quot;get&quot;, &quot;post&quot;, Route = null)] HttpRequest req, ILogger log) {
        log.LogInformation($&quot;GetVolumeData function executed at: 
         {DateTime.Now}&quot;);
        try {
          CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Parameter.ConnectionString);
          CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
          CloudBlobContainer cloudcontainer = cloudBlobClient.GetContainerReference(Parameter.SuccessContainer);
  
          BlobResultSegment resultSegment = await
          cloudcontainer.ListBlobsSegmentedAsync(currentToken: null);
          IEnumerable &lt;IListBlobItem&gt; blobItems = resultSegment.Results;
  
          string response = &quot;&quot;;
          int count = 0;
          //string blobName = &quot;&quot;;
  
          foreach(IListBlobItem item in blobItems) {
            var type = item.GetType();
            if (type == typeof(CloudBlockBlob)) {
              CloudBlockBlob blob = (CloudBlockBlob) item;
              count++;
              var blobname = blob.Name;
              // response = blobname;
              response = blob.DownloadTextAsync().Result;
              //response = blob.DownloadToStream().Result;
            }
          }
  
          if (count == 0) {
            return new OkObjectResult(&quot;Error : File Not Found !!&quot;);
          } else {
            return new OkObjectResult(Convert.ToString(response));
          }
        } catch(Exception ex) {
          log.LogError($ &quot; Function Exception Message: {ex.Message}&quot;);
          return new OkObjectResult(ex.Message.ToString());
        } finally {
          log.LogInformation($&quot;Function- ENDED ON : {DateTime.Now}&quot;);
        }
      }
    }
  </code></pre>
  <p>how can I read embedded files from my blob file response and send it to http?</p>