public async Task <IBlobContainer> GetContainerAsync(string requestedName, string targetQueue, CancellationToken cancellationToken)
        {
            BlobServiceClient account = new BlobServiceClient(_connectionString, StorageRetryPolicy.GetBlobClientOptionsRetrySettings());

            BlobContainerClient container = account.GetBlobContainerClient(requestedName);
            await container.CreateIfNotExistsAsync();

            return(new Container(container));
        }
Ejemplo n.º 2
0
        public async Task <IBlobContainer> GetContainerAsync(string requestedName, string targetQueue, CancellationToken cancellationToken)
        {
            ContainerInformation info = await _helixApiStorage.NewAsync(new ContainerCreationRequest(30, requestedName, targetQueue), cancellationToken).ConfigureAwait(false);

            Uri containerUri         = new Uri($"https://{info.StorageAccountName}.blob.core.windows.net/{info.ContainerName}");
            AzureSasCredential creds = new AzureSasCredential(info.WriteToken);
            var container            = new BlobContainerClient(containerUri, creds, StorageRetryPolicy.GetBlobClientOptionsRetrySettings());

            return(new Container(container, info));
        }