Microsoft.WindowsAzure.CloudDrive
Defines extension methods for creating Windows Azure drives from storage account credentials.
Create a new instance of a object from a storage account.
The name of the storage account where the drive's data
is to be stored.
The path to the page blob where the drive's data
is to be stored.
A reference to a Windows Azure drive.
Represents a Windows Azure drive.
A Windows Azure drive acts as a local drive mounted on the file system and is accessible
to code running in a role. The data written to a Windows Azure drive is stored in a page blob
defined within the Windows Azure Blob service, and cached on the local file system. Because
data written to the drive is stored in a page blob, the data is maintained across the
lifecycle of the role instance.
Creates a new instance of a object.
A URI that identifies the page blob where the drive's data will be stored.
Credentials for the storage account that will contain the page blob.
Creates an NTFS-formatted Windows Azure drive and its associated page blob. The page blob
is created at the URI specified for this object.
The size of the drive to create. The minimum size permitted is 16 MB.
Creates an NTFS-formatted Windows Azure drive and its associated page blob if the drive does not already exist.
The page blob is created at the URI specified for this object.
The size of the drive to create. The minimum size permitted is 16 MB.
true if the Windows Azure drive was created, or false if it already existed.
Creates a snapshot of the page blob associated with this Windows Azure drive.
A URI to the newly created snapshot.
Copies the data in this Windows Azure drive to a new page blob.
The URI of the destination blob.
The copy operation takes place entirely within the Windows Azure Blob service and does not involve the client.
Deletes the Windows Azure drive and its associated page blob.
If the page blob behind this Windows Azure drive has associated snapshots, you must
delete the snapshots using the Windows Azure Managed API before deleting the drive.
Mounts the Windows Azure drive and returns a path to the drive on the local file system.
The size of the read cache for this mounted drive. Set this
parameter to 0 for unbuffered access to the drive.
The set of for mounting the drive.
The local path to the mounted drive.
A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created
from a snapshot of a page blob.
Note that before a role instance mounts a drive for the first time, it must initialize the cache
by calling the method.
To create a writable drive, create a new instance of the object, specifying
the desired URI for the page blob. Call the method, then call the Mount
method to mount the drive.
To create a read-only drive, call the method to create a new snapshot and
return the snapshot's URI, then create a new instance of the object from the snapshot's URI
and mount the drive.
When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page
blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive
with the same URI a second time, the operation is ignored and the Mount method returns the local path to the
existing drive.
If a role instance other than the one that has mounted the drive and acquired the lease attempts
to mount a drive with the same URI, the operation fails with a . Only one
instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may
mount the drive and successfully acquire its lease.
If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased.
Multiple role instances can mount and access the same read-only drive.
Mounts the Windows Azure drive using the specified drive letter and returns a path to the drive on the local file system.
The drive letter for the mounted drive.
The size of the read cache for this mounted drive. Set this
parameter to 0 for unbuffered access to the drive.
The set of for mounting the drive.
The local path to the mounted drive.
A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created
from a snapshot of a page blob.
Note that before a role instance mounts a drive for the first time, it must initialize the cache
by calling the method.
To create a writable drive, create a new instance of the object, specifying
the desired URI for the page blob. Call the method, then call the Mount
method to mount the drive.
To create a read-only drive, call the method to create a new snapshot and
return the snapshot's URI, then create a new instance of the object from the snapshot's URI
and mount the drive.
When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page
blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive
with the same URI a second time, the operation is ignored and the Mount method returns the local path to the
existing drive.
If a role instance other than the one that has mounted the drive and acquired the lease attempts
to mount a drive with the same URI, the operation fails with a . Only one
instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may
mount the drive and successfully acquire its lease.
If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased.
Multiple role instances can mount and access the same read-only drive.
Unmounts the drive and releases any lease associated with it.
Note that when you unmount a drive, its contents are not deleted. To delete the contents of
a drive, call the method.
Initializes the read cache for any subsequently mounted drives associated with the role instance.
The local file system path to the directory containing the cache.
If the directory does not exist, it will be created.
The total cache size, in megabytes.
Before you mount a drive, you must call the InitializeCache method to initialize a cache for the drive.
If a role instance attempts to mount a drive before a cache has been initialized, a
is thrown.
When a drive is mounted, it stores cache data in the cache defined by the most recent call to InitializeCache.
In other words, if a role instance calls the InitializeCache method a second time with different arguments,
any drives mounted subsequently will store cache data in the newly defined cache. Any previously mounted drives
continue to store cache data in the cache that was defined before those drives were mounted.
Returns a mapping of local file system paths for mounted drives to page blob URIs for the current role instance.
A read-only dictionary that maps local paths to page blob URIs.
Ensure operation is allowed in this context.
Gets the credentials for the storage account where this drive's data is stored.
Gets the local file system path to the mounted drive. Returns null if no drive is currently mounted.
Gets the URI of the page blob where this drive's data is stored.
Defines an exception that may be thrown on operations on Windows Azure drives.
Initializes a new instance of the class.
The that holds the serialized object data about the exception being thrown.
The that contains contextual information about the source or destination.
The parameter is null.
The class name is null or is zero (0).
Returns the exception code for this exception
Appends a path to a Uri correctly using "/" as separator
AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc")
=> new Uri("http://test.blob.core.windows.net/test/abc")
AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc")
=> new Uri("http://test.blob.core.windows.net/test/abc")
Append a relative path to a URI, handling trailing slashes appropriately.
Specifies options for mounting a Windows Azure drive.
No options specified for mounting the drive.
Acquires the lease for this instance and forces the drive to be mounted.
Attempts to fix file system errors. Note may result in loss of data. See remarks.
Setting this flag calls chkdsk /F
on the mounted drive.
To avoid any potential data-loss it is recommed a snapshot of the drive is taken first before
attempting to fix file system errors.
Use Shared Access Credentials to authenticate with the Azure Blob Service.
By default, Azure Drives will use the Account Shared Key to authenticate with the
Azure Blob Service. It requires the secret key to be cached outside the calling
process. This may be a security concern for some applications and the risk can be
mitigated by setting this flag. However if this flag is set and the calling
process is terminated, then the drive will auto-unmount when the Shared Access
Credentials expire.