/// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, <see href="https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string"/>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            this._uri      = conn.QueueEndpoint;
            this._pipeline = (options ?? new QueueClientOptions()).Build(conn.Credentials);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, <see href="https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string"/>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            _uri = conn.QueueEndpoint;
            options ??= new QueueClientOptions();
            _pipeline          = options.Build(conn.Credentials);
            _clientDiagnostics = new ClientDiagnostics(options);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, see
        /// <see href="https://docs.microsoft.com/azure/storage/common/storage-configure-connection-string">
        /// Configure Azure Storage connection strings</see>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            _uri = conn.QueueEndpoint;
            options ??= new QueueClientOptions();
            _pipeline                   = options.Build(conn.Credentials);
            _version                    = options.Version;
            _clientDiagnostics          = new ClientDiagnostics(options);
            _clientSideEncryption       = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
            _storageSharedKeyCredential = conn.Credentials as StorageSharedKeyCredential;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 /// <param name="storageSharedKeyCredential">
 /// The shared key credential used to sign requests.
 /// </param>
 internal QueueServiceClient(
     Uri serviceUri,
     HttpPipelinePolicy authentication,
     QueueClientOptions options,
     StorageSharedKeyCredential storageSharedKeyCredential)
 {
     _uri = serviceUri;
     options ??= new QueueClientOptions();
     _pipeline                   = options.Build(authentication);
     _version                    = options.Version;
     _clientDiagnostics          = new ClientDiagnostics(options);
     _clientSideEncryption       = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
     _storageSharedKeyCredential = storageSharedKeyCredential;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 /// <param name="storageSharedKeyCredential">
 /// The shared key credential used to sign requests.
 /// </param>
 internal QueueServiceClient(
     Uri serviceUri,
     HttpPipelinePolicy authentication,
     QueueClientOptions options,
     StorageSharedKeyCredential storageSharedKeyCredential)
 {
     Argument.AssertNotNull(serviceUri, nameof(serviceUri));
     _uri = serviceUri;
     options ??= new QueueClientOptions();
     _pipeline                   = options.Build(authentication);
     _version                    = options.Version;
     _clientDiagnostics          = new ClientDiagnostics(options);
     _clientSideEncryption       = QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions);
     _storageSharedKeyCredential = storageSharedKeyCredential;
     _messageEncoding            = options.MessageEncoding;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="connectionString">
        /// A connection string includes the authentication information
        /// required for your application to access data in an Azure Storage
        /// account at runtime.
        ///
        /// For more information, see
        /// <see href="https://docs.microsoft.com/azure/storage/common/storage-configure-connection-string">
        /// Configure Azure Storage connection strings</see>.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        public QueueServiceClient(string connectionString, QueueClientOptions options)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            _uri = conn.QueueEndpoint;
            options ??= new QueueClientOptions();
            _clientConfiguration = new QueueClientConfiguration(
                pipeline: options.Build(conn.Credentials),
                sharedKeyCredential: conn.Credentials as StorageSharedKeyCredential,
                clientDiagnostics: new StorageClientDiagnostics(options),
                version: options.Version,
                clientSideEncryption: QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions),
                messageEncoding: options.MessageEncoding,
                queueMessageDecodingFailedHandlers: options.GetMessageDecodingFailedHandlers());

            _serviceRestClient = BuildServiceRestClient();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueServiceClient"/>
        /// class.
        /// </summary>
        /// <param name="serviceUri">
        /// A <see cref="Uri"/> referencing the queue service.
        /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
        /// </param>
        /// <param name="authentication">
        /// An optional authentication policy used to sign requests.
        /// </param>
        /// <param name="options">
        /// Optional client options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        /// <param name="storageSharedKeyCredential">
        /// The shared key credential used to sign requests.
        /// </param>
        internal QueueServiceClient(
            Uri serviceUri,
            HttpPipelinePolicy authentication,
            QueueClientOptions options,
            StorageSharedKeyCredential storageSharedKeyCredential)
        {
            Argument.AssertNotNull(serviceUri, nameof(serviceUri));
            _uri = serviceUri;
            options ??= new QueueClientOptions();

            _clientConfiguration = new QueueClientConfiguration(
                pipeline: options.Build(authentication),
                sharedKeyCredential: storageSharedKeyCredential,
                clientDiagnostics: new StorageClientDiagnostics(options),
                version: options.Version,
                clientSideEncryption: QueueClientSideEncryptionOptions.CloneFrom(options._clientSideEncryptionOptions),
                messageEncoding: options.MessageEncoding,
                queueMessageDecodingFailedHandlers: options.GetMessageDecodingFailedHandlers());

            _serviceRestClient = BuildServiceRestClient();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 internal QueueServiceClient(Uri serviceUri, HttpPipelinePolicy authentication, QueueClientOptions options)
 {
     this._uri      = serviceUri;
     this._pipeline = (options ?? new QueueClientOptions()).Build(authentication);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="credential">
 /// The token credential used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 public QueueServiceClient(Uri serviceUri, TokenCredential credential, QueueClientOptions options = default)
     : this(serviceUri, credential.AsPolicy(), options)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="credential">
 /// The shared key credential used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 public QueueServiceClient(Uri serviceUri, StorageSharedKeyCredential credential, QueueClientOptions options = default)
     : this(serviceUri, credential.AsPolicy(), options)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 public QueueServiceClient(Uri serviceUri, QueueClientOptions options = default)
     : this(serviceUri, (HttpPipelinePolicy)null, options)
 {
 }
Exemple #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="authentication">
 /// An optional authentication policy used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 internal QueueServiceClient(Uri serviceUri, HttpPipelinePolicy authentication, QueueClientOptions options)
 {
     _uri = serviceUri;
     options ??= new QueueClientOptions();
     _pipeline          = options.Build(authentication);
     _clientDiagnostics = new ClientDiagnostics(options);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// </param>
 /// <param name="credential">
 /// The token credential used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 public QueueServiceClient(Uri serviceUri, TokenCredential credential, QueueClientOptions options = default)
     : this(serviceUri, credential.AsPolicy(options), options, null)
 {
     Errors.VerifyHttpsTokenAuth(serviceUri);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="serviceUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
 /// Must not contain shared access signature, which should be passed in the second parameter.
 /// </param>
 /// <param name="credential">
 /// The shared access signature credential used to sign requests.
 /// </param>
 /// <param name="options">
 /// Optional client options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 /// <remarks>
 /// This constructor should only be used when shared access signature needs to be updated during lifespan of this client.
 /// </remarks>
 public QueueServiceClient(Uri serviceUri, AzureSasCredential credential, QueueClientOptions options = default)
     : this(serviceUri, credential.AsPolicy <QueueUriBuilder>(serviceUri), options, null)
 {
 }