public override void PerformPublish(string rootPath, string[] filesToPublish) { if (string.IsNullOrEmpty(data.AccountName) || string.IsNullOrEmpty(data.AccountKey) || string.IsNullOrEmpty(data.BlobPath)) { PublishingHost.ShowMessageBox("You need to enter your Windows Azure storage account information before proceeding", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } cancelled = false; var blobs = new CloudStorageAccount(new StorageCredentialsAccountAndKey(data.AccountName, data.AccountKey), true).CreateCloudBlobClient(); CreateClientAccessPolicy(blobs); var directory = blobs.GetBlobDirectoryReference(data.BlobPath); if (directory.Container.CreateIfNotExist()) { directory.Container.SetPermissions(new BlobContainerPermissions() { PublicAccess = BlobContainerPublicAccessType.Blob }); } int count = 0; var files = Directory.EnumerateFiles(rootPath).ToList(); Parallel.ForEach(files, (file) => { var blob = directory.GetBlobReference(Path.GetFileName(file)); if (file.Contains(".ismv")) { blob.Properties.ContentType = "video/ismv"; } blob.Properties.CacheControl = "max-age=7200"; blob.UploadFile(file); OnProgress(string.Format("Uploaded {0} of {1} files", Interlocked.Increment(ref count), files.Count), (double)count/files.Count); }); }