/// <summary> /// Appends a string to the end of a blob (creating the blob and appending a header if the blob doesn't exist). /// Before calling this method, set the blob's ContentType Property (ex: "text/csv; charset=utf-8") /// </summary> /// <param name="blob">The blob to have the string appended to.</param> /// <param name="string">The string to append.</param> /// <param name="header">The header string to put in the blob if the blob is being created.</param> /// <param name="maxBlockSize">The maximum block sized in bytes (0=Azure default of 4MB)</param> /// <param name="options">A Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions object that specifies additional options for the request.</param> /// <param name="operationContext">An Microsoft.WindowsAzure.Storage.OperationContext object that represents the context for the current operation.</param> /// <param name="cancellationToken">A System.Threading.CancellationToken to observe while waiting for a task to complete.</param> /// <returns>A System.Threading.Tasks.Task object that represents the current operation.</returns> public static Task AppendAsync(this CloudBlockBlob blob, String @string, Byte[] header, Int32 maxBlockSize = 0, BlobRequestOptions options = null, OperationContext operationContext = null, CancellationToken cancellationToken = default(CancellationToken)) { return(blob.AppendAsync(new MemoryStream(@string.Encode()), header, maxBlockSize, options, operationContext, cancellationToken)); }