Export (0) Print
Expand All

CloudPageBlob.Create Method (Int64, BlobRequestOptions)

Updated: April 24, 2013

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Creates a page blob, using a conditional request based on the BlobRequestOptions specified.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

'Usage
Dim instance As CloudPageBlob
Dim size As Long
Dim options As BlobRequestOptions

instance.Create(size, options)

public void Create (
	long size,
	BlobRequestOptions options
)

Parameters

size

Type: System.Int64

The maximum size of the blob, in bytes. This value must be a multiple of 512.

options

An object that specifies any additional options for the request.

The following code example creates a page blob that has a maximum size of 4 MB.

static void CreatePageBlob(Uri blobEndpoint, string accountName, string accountKey)
{
    //Create service client for credentialed access to the Blob service.
    CloudBlobClient blobClient = 
        new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Get a reference to the page blob.
    CloudPageBlob pageBlob = blobClient.GetPageBlobReference("mycontainer/mypageblob");

    //Create a page blob 4 MB in size.
    pageBlob.Create(4194304);

    //Verify that this is a page blob.
    pageBlob.FetchAttributes();
    Console.WriteLine(pageBlob.Properties.BlobType);
}


To create a page blob, call Create, specifying the maximum size of the page blob in bytes. A page blob may be up to 1 TB in size.


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, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

 

Show:
© 2014 Microsoft