CloudQueue Constructor

Updated: September 27, 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.]

Initializes a new instance of the CloudQueue class.

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

'Usage
Dim address As String
Dim credentials As StorageCredentials

Dim instance As New CloudQueue(address, credentials)

public CloudQueue (
	string address,
	StorageCredentials credentials
)

Parameters

address

Type: System.String

The absolute URI to the queue.

credentials

Type: Microsoft.WindowsAzure.StorageCredentials

The account credentials.

The following code example uses the CloudQueue constructor to create a queue:

  public CloudQueue CreateNewQueue(string queueAbsoluteURI, string AccountName, string AccessKey )
  {
    StorageCredentialsAccountAndKey credentials;
    CloudQueue newQueue = null;
    try
    {
      credentials = new StorageCredentialsAccountAndKey( AccountName, AccessKey );
      newQueue = new CloudQueue( queueAbsoluteURI, credentials );
      newQueue.Create( );
    }
    catch( Exception ex )
    {
      Trace.TraceError( string.Format( 
        "Failed to create new CloudQueue at URI '{0}'; reason: {1}.",
          queueAbsoluteURI, ex.Message ) );
      return ( null );
    }
    return ( newQueue );
  }

See the GetQueueReference method for an alternate way to create a new CloudQueue object.


Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

 

Reference

CloudQueue Class
CloudQueue Members
Microsoft.WindowsAzure.StorageClient Namespace

Show: