public TableServiceContext(Uri tablesBaseUri, IStorageCredentials credentials)
            : base(tablesBaseUri)
        {
            this.StorageCredentials = credentials;

            this.SendingRequest += this.OnSendingRequest;
            this.IgnoreMissingProperties = true;
            this.MergeOption = MergeOption.PreserveChanges;
        }
        /// <summary>
        /// Initializes a new instance of the CloudQueueClient class.
        /// </summary>
        /// <param name="queuesBaseUri">The Queues endpoint.</param>
        /// <param name="credentials">The storage credentials.</param>
        /// <param name="dispatcher">The dispatcher used to invoke the callbacks.</param>
        public CloudQueueClient(Uri queuesBaseUri, IStorageCredentials credentials, Dispatcher dispatcher)
            : base(dispatcher)
        {
            if (queuesBaseUri == null)
                throw new ArgumentNullException("queuesBaseUri", "The Queues base uri cannot be null.");

            if (credentials == null)
                throw new ArgumentNullException("credentials", "The storage credentials cannot be null.");

            this.queuesBaseUri = queuesBaseUri;
            this.Credentials = credentials;
        }
        public StorageAccountCloudBlobContainer(Uri uri, string name, IStorageCredentials credentials, Dispatcher dispatcher)
            : base(name, dispatcher)
        {
            if (uri == null)
                throw new ArgumentNullException("uri", "The container uri cannot be null.");

            if (credentials == null)
                throw new ArgumentNullException("credentials", "The credentials cannot be null.");

            this.uri = uri;
            this.Credentials = credentials;
        }
        /// <summary>
        /// Initializes a new instance of the CloudBlobClient class using the Windows Azure Storage Account credentials to perform operations.
        /// </summary>
        /// <param name="blobsBaseUri">The blobs endpoint.</param>
        /// <param name="credentials">The storage credentials.</param>
        /// <param name="dispatcher">The dispatcher used to invoke the callbacks.</param>
        public CloudBlobClient(Uri blobsBaseUri, IStorageCredentials credentials, Dispatcher dispatcher)
        {
            if (blobsBaseUri == null)
                throw new ArgumentNullException("blobsBaseUri", "The Blobs base uri cannot be null.");

            if (credentials == null)
                throw new ArgumentNullException("credentials", "The storage credentials cannot be null.");

            this.Credentials = credentials;
            this.Dispatcher = dispatcher;
            this.strategy = new InnerStorageAccountCloudBlobClientStrategy(blobsBaseUri, this.Credentials, dispatcher);
        }
        public CloudTableClient(Uri tablesBaseUri, IStorageCredentials credentials, Dispatcher dispatcher)
        {
            if (tablesBaseUri == null)
                throw new ArgumentNullException("tablesBaseUri", "Table Base Uri cannot be null.");

            if (credentials == null)
                throw new ArgumentNullException("credentials", "Credentials cannot be null.");

            this.dispatcher = dispatcher;
            this.TablesBaseUri = tablesBaseUri;
            this.Credentials = credentials;
        }
Example #6
0
        public CloudBlobUploader(Stream fileStream, Uri uploadUri, WebHeaderCollection metadata, IStorageCredentials credentials)
        {
            this.Credentials = credentials;

            this.fileStream = fileStream;
            this.uploadUri = uploadUri;
            this.dataLength = this.fileStream.Length;
            this.dataSent = 0;

            this.metadata = metadata != null ? metadata : new WebHeaderCollection();

            // Upload the blob in smaller blocks if it's a "big" file.
            this.useBlocks = (this.dataLength - this.dataSent) > ChunkSize;
        }
        public TableServiceContext(string baseAddress, IStorageCredentials credentials)
            : base(new Uri(baseAddress))
        {
            if (string.IsNullOrWhiteSpace(baseAddress))
            {
                throw new ArgumentNullException("baseAddress");
            }

            this.SendingRequest += this.DataContextSendingRequest;
            this.IgnoreMissingProperties = true;
            this.MergeOption = MergeOption.PreserveChanges;

            this.StorageCredentials = credentials;
        }
Example #8
0
 /// <summary>
 /// Create and configure connection option instances to use a test
 /// specific retry policy and response classifier.
 ///
 /// We're willing to wait longer and make gratuitous retries than our
 /// default connection options for the sake of robust test execution.
 /// </summary>
 /// <typeparam name="T">The type of StorageConnectionOptions.</typeparam>
 /// <param name="credentials">Optional credentials.</param>
 /// <returns>The modified connection options.</returns>
 public static T GetOptions <T>(IStorageCredentials credentials = default)
     where T : StorageConnectionOptions, new()
 => new T
 {
     Credentials        = credentials,
     ResponseClassifier = new TestResponseClassifier(),
     LoggingPolicy      = LoggingPolicy.Shared,
     RetryPolicy        =
         new ExponentialRetryPolicy()
     {
         MaxRetries = Azure.Storage.Constants.MaxReliabilityRetries,
         Delay      = TimeSpan.FromSeconds(0.5),
         MaxDelay   = TimeSpan.FromSeconds(10)
     }
 };
        public CloudBlobUploader(Stream fileStream, Uri cloudBlobUri, IDictionary<string, string> metadata, BlobProperties blobProperties, IStorageCredentials credentials, Dispatcher dispatcher)
        {
            this.fileStream = fileStream;
            this.cloudBlobUri = cloudBlobUri;
            this.metadata = metadata;
            this.blobProperties = blobProperties;
            this.credentials = credentials;

            this.dataLength = this.fileStream.Length;
            this.dataSent = 0;

            this.dispatcher = dispatcher;

            // Upload the blob in smaller blocks if it's a "big" stream.
            this.useBlocks = (this.dataLength - this.dataSent) > ChunkSize;
        }
Example #10
0
 public FileConnectionOptions GetOptions(IStorageCredentials credentials = null)
 => this.Recording.InstrumentClientOptions(
     new FileConnectionOptions
 {
     Credentials        = credentials,
     ResponseClassifier = new TestResponseClassifier(),
     LoggingPolicy      = LoggingPolicy.Shared,
     RetryPolicy        =
         new RetryPolicy()
     {
         Mode       = RetryMode.Exponential,
         MaxRetries = Azure.Storage.Constants.MaxReliabilityRetries,
         Delay      = TimeSpan.FromSeconds(this.Mode == RecordedTestMode.Playback ? 0.01 : 0.5),
         MaxDelay   = TimeSpan.FromSeconds(this.Mode == RecordedTestMode.Playback ? 0.1 : 10)
     }
 });
        public CloudQueue(Uri uri, string name, IStorageCredentials credentials, Dispatcher dispatcher)
            : base(dispatcher)
        {
            if (uri == null)
                throw new ArgumentNullException("uri", "The queue uri cannot be null.");

            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentException("The queue name cannot be null, empty or white space.", "name");

            if (credentials == null)
                throw new ArgumentNullException("credentials", "The storage credentials cannot be null.");

            this.Uri = uri;
            this.Name = name;
            this.Credentials = credentials;
            this.Metadata = new Dictionary<string, string>();
        }
        public CloudStorageClientResolverAccountAndKey(IStorageCredentials credentials, Uri blobEndpoint, Uri queueEndpoint, Uri tableEndpoint, Dispatcher dispatcher)
        {
            if (credentials == null)
                throw new ArgumentNullException("credentials", "The storage credentials cannot be null.");

            if (blobEndpoint == null)
                throw new ArgumentNullException("blobEndpoint", "The Blob endpoint cannot be null.");

            if (queueEndpoint == null)
                throw new ArgumentNullException("queueEndpoint", "The Queues endpoint cannot be null.");

            if (tableEndpoint == null)
                throw new ArgumentNullException("tableEndpoint", "The Tables endpoint cannot be null.");

            this.Credentials = credentials;
            this.blobEndpoint = blobEndpoint;
            this.queuesBaseUri = queueEndpoint;
            this.tablesBaseUri = tableEndpoint;
            this.dispatcher = dispatcher;
        }
 /// <summary>
 /// Initializes a new instance of the CloudQueueClient class to perform operations with Queues using the Azure Storage credentials.
 /// </summary>
 /// <param name="queueBaseAddress">The Queue service endpoint to use to create the client.</param>
 /// <param name="credentials">The account credentials.</param>
 public CloudQueueClient(string queueBaseAddress, IStorageCredentials credentials)
 {
     this.queueBaseUri = new Uri(queueBaseAddress, UriKind.Absolute);
     this.StorageCredentials = credentials;
 }
 /// <summary>
 /// Initializes a new instance of the CloudBlobClient class using the Windows Azure Storage Account credentials to perform operations.
 /// </summary>
 /// <param name="blobsBaseUri">The blobs endpoint.</param>
 /// <param name="credentials">The storage credentials.</param>
 public CloudBlobClient(Uri blobsBaseUri, IStorageCredentials credentials)
     : this(blobsBaseUri, credentials, null)
 {
 }
 public StorageAccountCloudBlob(ICloudBlobContainer container, IStorageCredentials credentials)
     : base(container)
 {
     this.Credentials = credentials;
 }
 public StorageAccountCloudBlobClientStrategy(string storageAccountEndpoint, IStorageCredentials credentials = null)
 {
     this.storageAccountEndpoint = new Uri(storageAccountEndpoint, UriKind.Absolute);
     this.Credentials = credentials ?? new StorageCredentialsAnonymous();
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the CloudBlobClient class to perform operations with Blobs and Containers using the Azure Storage credentials.
 /// </summary>
 /// <param name="containerBaseAddress">The Blob service endpoint to use to create the client.</param>
 /// <param name="credentials">The account credentials.</param>
 public CloudBlobClient(string storageAccountEndpoint, IStorageCredentials credentials = null)
 {
     this.Credentials = credentials ?? new StorageCredentialsAnonymous();
     this.strategy = new StorageAccountCloudBlobClientStrategy(storageAccountEndpoint, this.Credentials);
 }
 public StorageAccountCloudBlobContainer(IStorageCredentials credentials)
 {
     this.Credentials = credentials;
 }
 public CloudStorageClientResolverAccountAndKey(IStorageCredentials credentials, Uri blobEndpoint, Uri queueEndpoint, Uri tableEndpoint)
     : this(credentials, tableEndpoint, queueEndpoint, blobEndpoint, null)
 {
 }
 public SharedAccessSignatureServiceClient(string sasServiceAddress, IStorageCredentials credentials)
 {
     this.sasServiceAddress = new Uri(sasServiceAddress, UriKind.Absolute);
     this.Credentials = credentials;
 }
 public InnerStorageAccountCloudBlobClientStrategy(Uri blobsBaseUri, IStorageCredentials credentials, Dispatcher dispatcher)
     : base(dispatcher)
 {
     this.blobsBaseUri = blobsBaseUri;
     this.Credentials = credentials;
 }
 /// <summary>
 /// Initializes a new instance of the CloudQueueClient class.
 /// </summary>
 /// <param name="queuesBaseUri">The Queues endpoint.</param>
 /// <param name="credentials">The storage credentials.</param>
 public CloudQueueClient(Uri queuesBaseUri, IStorageCredentials credentials)
     : this(queuesBaseUri, credentials, null)
 {
 }
 public StorageAccountCloudBlobContainer(Uri uri, string name, IStorageCredentials credentials)
     : this(uri, name, credentials, null)
 {
 }
 public CloudTableClient(Uri tablesBaseUri, IStorageCredentials credentials)
     : this(tablesBaseUri, credentials, null)
 {
 }
Example #25
0
 public RegistrationClient(string serviceUri, IStorageCredentials storageCredentials)
 {
     this.serviceUri = serviceUri;
     this.storageCredentials = storageCredentials;
 }