/// <summary> /// deletes the blob container (and therefore all the blobs) /// </summary> /// <param name="blobStoreManager">cached blob store manager</param> /// <param name="azureBlobStorageConnectionString">connection string to azure blob storage</param> /// <returns>delete task</returns> private static async Task DeleteAzureBlobs(ICBStoreManager blobStoreManager, string azureBlobStorageConnectionString) { Console.WriteLine("Deleting all blobs from Azure Blob Store..."); AzureBlobStorage azureBlobStorage = new AzureBlobStorage(azureBlobStorageConnectionString); CBStore store = new CBStore(azureBlobStorage, null); foreach (ContainerIdentifier containerIdentifier in Enum.GetValues(typeof(ContainerIdentifier))) { if (!ContainerDescriptorProvider.Containers.ContainsKey(containerIdentifier)) { Console.WriteLine(" " + containerIdentifier.ToString() + " - Descriptor not found"); continue; } string containerName = blobStoreManager.GetContainerName(containerIdentifier); await store.DeleteContainerAsync(containerName); Console.WriteLine(" " + containerIdentifier.ToString() + " - Container Deleted"); } }
/// <summary> /// Initializes a new instance of the <see cref="BlobsStore"/> class /// </summary> /// <param name="blobStoreManager">cached blob store manager</param> public BlobsStore(ICBStoreManager blobStoreManager) { this.blobStoreManager = blobStoreManager; }