Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.59 KB

functions-bindings-blob-storage-output-usage.md

File metadata and controls

36 lines (29 loc) · 1.59 KB
title description services author manager ms.service ms.topic ms.date ms.author ms.custom
include file
include file
functions
craigshoemaker
gwallace
azure-functions
include
08/02/2019
cshoe
include file

You can bind to the following types to write blobs:

  • TextWriter
  • out string
  • out Byte[]
  • CloudBlobStream
  • Stream
  • CloudBlobContainer1
  • CloudBlobDirectory
  • ICloudBlob2
  • CloudBlockBlob2
  • CloudPageBlob2
  • CloudAppendBlob2

1 Requires "in" binding direction in function.json or FileAccess.Read in a C# class library. However, you can use the container object that the runtime provides to do write operations, such as uploading blobs to the container.

2 Requires "inout" binding direction in function.json or FileAccess.ReadWrite in a C# class library.

If you try to bind to one of the Storage SDK types and get an error message, make sure that you have a reference to the correct Storage SDK version.

In async functions, use the return value or IAsyncCollector instead of an out parameter.

Binding to string or Byte[] is only recommended if the blob size is small, as the entire blob contents are loaded into memory. Generally, it is preferable to use a Stream or CloudBlockBlob type. For more information, see Concurrency and memory usage earlier in this article.