Пример #1
0
        protected async Task<CloudBlobContainer> GetBlobContainer(StorageContainerTarget target)
        {
            // construct a cloud blob client for the configured storage account
            var cloudBlobClient = target.StorageAccount.CreateCloudBlobClient();
            cloudBlobClient.DefaultRequestOptions.RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(10), 5);

            // get the target blob container (to store the generated reports)
            var targetBlobContainer = cloudBlobClient.GetContainerReference(target.ContainerName);
            await targetBlobContainer.CreateIfNotExistsAsync();
            var blobContainerPermissions = new BlobContainerPermissions();
            blobContainerPermissions.PublicAccess = BlobContainerPublicAccessType.Blob;
            await targetBlobContainer.SetPermissionsAsync(blobContainerPermissions);
            return targetBlobContainer;
        }
Пример #2
0
        protected async Task <CloudBlobContainer> GetBlobContainer(StorageContainerTarget target)
        {
            // construct a cloud blob client for the configured storage account
            var cloudBlobClient = target.StorageAccount.CreateCloudBlobClient();

            cloudBlobClient.DefaultRequestOptions.RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(10), 5);

            // get the target blob container (to store the generated reports)
            var targetBlobContainer = cloudBlobClient.GetContainerReference(target.ContainerName);
            await targetBlobContainer.CreateIfNotExistsAsync();

            var blobContainerPermissions = new BlobContainerPermissions();

            blobContainerPermissions.PublicAccess = BlobContainerPublicAccessType.Blob;
            await targetBlobContainer.SetPermissionsAsync(blobContainerPermissions);

            return(targetBlobContainer);
        }