Create Container In Azure Blob Storage

  1. string storageConnectionString = ConfigurationManager.ConnectionStrings["Storage"].ConnectionString;  
  2. string containerName = "samplecontainer";  
  3. CloudStorageAccount Account = CloudStorageAccount.Parse(storageConnectionString);  
  4. CloudBlobClient BlobClient = Account.CreateCloudBlobClient();  
  5. BlobClient.RetryPolicy = RetryPolicies.Retry(4, TimeSpan.Zero);  
  6.   
  7. try  
  8. {  
  9.     CloudBlobContainer container = BlobClient.GetContainerReference(containerName);  
  10.     container.Create();  
  11. }  
  12. catch (StorageClientException ex)  
  13. {  
  14.      
  15. }