コード例 #1
0
        private async Task <CloudBlockBlob> GetBlockBlobAsync(string containerName, string blockName)
        {
            var blobContainer = new CloudStorageAccount(new StorageCredentials(_accountName, _storageKey), true).CreateCloudBlobClient().GetContainerReference(containerName);
            await blobContainer.CreateIfNotExistsAsync();

            return(blobContainer.GetBlockBlobReference(blockName));
        }
コード例 #2
0
        private CloudBlobContainer GetBlobContainer(string containerName)
        {
            var container = new CloudStorageAccount(
                new StorageCredentials(_settings.StorageAccountName, _settings.StorageAccountKey), true)
                            .CreateCloudBlobClient()
                            .GetContainerReference(containerName);

            container.CreateIfNotExistsAsync().Wait();
            return(container);
        }
 public async Task CreateTableIfNotExistsAsync(string tableName)
 {
     await _storageAccount.CreateIfNotExistsAsync(tableName);
 }