CloudBlob.UploadText Method (String)
Uploads a string of text to a block blob.
Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
The following code example uploads a blob from text. This example overwrites the blob if it already exists in the container.
static void UploadBlobFromText(Uri blobEndpoint, string accountName, string accountKey) { // Create service client for credentialed access to the blob. CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey)); // Get a reference to the blob. CloudBlob blob = blobClient.GetBlobReference("mycontainer/myblob.txt"); // Upload the blob from a text string. blob.UploadText("Upload a blob from text."); }
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Development Platforms
Windows Vista, Windows 7 and Windows Server 2008Target Platforms