[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.
Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
Usage
Visual Basic |
---|
Dim instance As CloudPageBlob
Dim size As Long
instance.Create(size) |
Syntax
Visual Basic |
---|
Public Sub Create ( _
size As Long _
) |
C# |
---|
public void Create (
long size
) |
C++ |
---|
public:
void Create (
long long size
) |
Parameters
- size
Type: System.Int64
The maximum size of the blob, in bytes. This value must be a multiple of 512.
Example
The following code example creates a page blob that has a maximum size of 4 MB.
C# | Copy Code |
---|
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);
}
|
Remarks
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Change History
See Also