Example #1
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="connectionOptions">
        /// Optional connection options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        /// <remarks>
        /// The credentials on <paramref name="connectionString"/> will override those on <paramref name="connectionOptions"/>.
        /// </remarks>
        public QueueServiceClient(string connectionString, QueueConnectionOptions connectionOptions = default)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            // TODO: perform a copy of the options instead
            var connOptions = connectionOptions ?? new QueueConnectionOptions();

            connOptions.Credentials = conn.Credentials;

            this.Uri       = conn.QueueEndpoint;
            this._pipeline = connOptions.Build();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueClient"/>
        /// 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="queueName">
        /// The name of the queue in the storage account to reference.
        /// </param>
        /// <param name="connectionOptions">
        /// Optional connection options that define the transport pipeline
        /// policies for authentication, retries, etc., that are applied to
        /// every request.
        /// </param>
        /// <remarks>
        /// The credentials on <paramref name="connectionString"/> will override those on <paramref name="connectionOptions"/>.
        /// </remarks>
        public QueueClient(string connectionString, string queueName, QueueConnectionOptions connectionOptions = default)
        {
            var conn = StorageConnectionString.Parse(connectionString);

            var builder =
                new QueueUriBuilder(conn.QueueEndpoint)
            {
                QueueName = queueName
            };

            // TODO: perform a copy of the options instead
            var connOptions = connectionOptions ?? new QueueConnectionOptions();

            connOptions.Credentials = conn.Credentials;

            this.Uri       = builder.ToUri();
            this._pipeline = connOptions.Build();
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueueServiceClient"/>
 /// class.
 /// </summary>
 /// <param name="primaryUri">
 /// A <see cref="Uri"/> referencing the queue service.
 /// </param>
 /// <param name="connectionOptions">
 /// Optional connection options that define the transport pipeline
 /// policies for authentication, retries, etc., that are applied to
 /// every request.
 /// </param>
 public QueueServiceClient(Uri primaryUri, QueueConnectionOptions connectionOptions = default)
     : this(primaryUri, (connectionOptions ?? new QueueConnectionOptions()).Build())
 {
 }
Example #4
0
 /// <summary>
 /// Creates a <see cref="MessageIdClient"/>.
 /// </summary>
 /// <param name="primaryUri">
 /// The primary <see cref="Uri"/> endpoint for the service.
 /// </param>
 /// <param name="connectionOptions">
 /// Optional <see cref="QueueConnectionOptions"/>
 /// </param>
 public MessageIdClient(Uri primaryUri, QueueConnectionOptions connectionOptions = default)
     : this(primaryUri, (connectionOptions ?? new QueueConnectionOptions()).Build())
 {
 }