共用方式為


CloudStorageAccount Class

Definition

Represents a Microsoft Azure Storage account.

public class CloudStorageAccount
type CloudStorageAccount = class
Public Class CloudStorageAccount
Inheritance
CloudStorageAccount

Examples


// Create a CloudStorageAccount object using account name and key.
// The account name should be just the name of a Storage Account, not a URI, and 
// not including the suffix. The key should be a base-64 encoded string that you
// can acquire from the portal, or from the management plane.
// This will have full permissions to all operations on the account.
StorageCredentials storageCredentials = new StorageCredentials(myAccountName, myAccountKey);
CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(storageCredentials, useHttps: true);

// Create a CloudBlobClient object from the storage account.
// This object is the root object for all operations on the 
// blob service for this particular account.
CloudBlobClient blobClient = cloudStorageAccount.CreateCloudBlobClient();

// Get a reference to a CloudBlobContainer object in this account. 
// This object can be used to create the container on the service, 
// list blobs, delete the container, etc. This operation does not make a 
// call to the Azure Storage service.  It neither creates the container 
// on the service, nor validates its existence.
CloudBlobContainer container = blobClient.GetContainerReference("container1");


// Create a CloudQueueClient object from the storage account.
// This object is the root object for all operations on the 
// queue service for this particular account.
CloudQueueClient queueClient = cloudStorageAccount.CreateCloudQueueClient();

// Get a reference to a CloudQueue object in this account. 
// This object can be used to create the queue on the service, 
// delete the queue, add messages, etc. This operation does not
// make a call to the Azure Storage service.  It neither creates 
// the queue on the service, nor validates its existence.
CloudQueue queue = queueClient.GetQueueReference("queue1");

// Create a CloudFileClient object from the storage account.
// This object is the root object for all operations on the 
// file service for this particular account.
CloudFileClient fileClient = cloudStorageAccount.CreateCloudFileClient();

// Get a reference to a CloudFileShare object in this account. 
// This object can be used to create the share on the service, 
// delete the share, list files and directories, etc. This operation 
// does not make a call to the Azure Storage service. It neither 
// creates the share on the service, nor validates its existence.
CloudFileShare share = fileClient.GetShareReference("share1");

Constructors

CloudStorageAccount(StorageCredentials, Boolean)

Initializes a new instance of the CloudStorageAccount class using the specified credentials, and specifies whether to use HTTP or HTTPS to connect to the storage services.

CloudStorageAccount(StorageCredentials, StorageUri, StorageUri, StorageUri, StorageUri)

Initializes a new instance of the CloudStorageAccount class using the specified account credentials and service endpoints.

CloudStorageAccount(StorageCredentials, String, Boolean)

Initializes a new instance of the CloudStorageAccount class using the specified credentials and endpoint suffix, and specifies whether to use HTTP or HTTPS to connect to the storage services.

CloudStorageAccount(StorageCredentials, String, String, Boolean)

Initializes a new instance of the CloudStorageAccount class using the specified credentials and endpoint suffix, and specifies whether to use HTTP or HTTPS to connect to the storage services.

CloudStorageAccount(StorageCredentials, Uri, Uri, Uri, Uri)

Initializes a new instance of the CloudStorageAccount class using the specified credentials and service endpoints.

Properties

BlobEndpoint

Gets the primary endpoint for the Blob service, as configured for the storage account.

BlobStorageUri

Gets the endpoints for the Blob service at the primary and secondary location, as configured for the storage account.

Credentials

Gets the credentials used to create this CloudStorageAccount object.

DevelopmentStorageAccount

Gets a CloudStorageAccount object that references the well-known development storage account.

FileEndpoint

Gets the primary endpoint for the File service, as configured for the storage account.

FileStorageUri

Gets the endpoints for the File service at the primary and secondary location, as configured for the storage account.

QueueEndpoint

Gets the primary endpoint for the Queue service, as configured for the storage account.

QueueStorageUri

Gets the endpoints for the Queue service at the primary and secondary location, as configured for the storage account.

TableEndpoint

Gets the primary endpoint for the Table service, as configured for the storage account.

TableStorageUri

Gets the endpoints for the Table service at the primary and secondary location, as configured for the storage account.

UseV1MD5

Gets or sets a value indicating whether the FISMA MD5 setting will be used.

Methods

GetSharedAccessSignature(SharedAccessAccountPolicy)

Returns a shared access signature for the account.

Parse(String)

Parses a connection string and returns a CloudStorageAccount created from the connection string.

ToString()

Returns a connection string for this storage account, without sensitive data.

ToString(Boolean)

Returns a connection string for the storage account, optionally with sensitive data.

TryParse(String, CloudStorageAccount)

Indicates whether a connection string can be parsed to return a CloudStorageAccount object.

Extension Methods

CreateCloudBlobClient(CloudStorageAccount)

Creates the Blob service client.

CreateCloudFileClient(CloudStorageAccount)

Creates the File service client.

CreateCloudQueueClient(CloudStorageAccount)

Creates the Queue service client.

Applies to