/// <summary> /// NB Not using GetBlobReferenceFromServer for destination as this requires a lot of complex exception handling. /// </summary> public static CloudBlockBlob?GetBlobDirect(this IStorageAccountConfig config, string relativePath, AccessCondition?ac = null) { var sourceAccount = CloudStorageAccount.Parse(config.ConnectionString); var sourceBlobClient = sourceAccount.CreateCloudBlobClient(); return(sourceBlobClient.GetBlobReferenceFromServer( new StorageUri(new Uri(sourceBlobClient.BaseUri, relativePath)), ac) as CloudBlockBlob); }
/// <summary> /// Use for source blobs /// </summary> public static CloudBlockBlob GetBlobIndirect(this IStorageAccountConfig config, string relativePath) { var destinationAccount = CloudStorageAccount.Parse(config.ConnectionString); var destinationBlobClient = destinationAccount.CreateCloudBlobClient(); var containerName = relativePath.Split("/", StringSplitOptions.RemoveEmptyEntries)[0]; var path = string.Join("/", relativePath.Split("/", StringSplitOptions.RemoveEmptyEntries).Skip(1)); var containerReference = destinationBlobClient.GetContainerReference(containerName); return(containerReference.GetBlockBlobReference(path)); }
public MutableBlobCopyCommand(IStorageAccountConfig sourceStorageAccountConfig, IStorageAccountConfig destinationStorageAccountConfig) { _SourceStorageAccountConfig = sourceStorageAccountConfig; _DestinationStorageAccountConfig = destinationStorageAccountConfig; }
public StorageClientEx(IStorageAccountConfig storageAccountConfig) { var c = CloudStorageAccount.Parse(storageAccountConfig.ConnectionString); _BlobClient = new CloudBlobClient(c.BlobEndpoint, c.Credentials); }
public BlobWriterBase(IStorageAccountConfig storageAccountConfig) { _StorageAccountConfig = storageAccountConfig; }
public StandardBlobWriter(IStorageAccountConfig storageAccountConfig) : base(storageAccountConfig) { }
public ManifestBlobWriter(IStorageAccountConfig storageAccountConfig) : base(storageAccountConfig) { }