AzureStorageAlias.

DeleteBlobsByPrefix(ICakeContext, AzureStorageSettings) Method

Summary

Deletes an Azure Storage blobs by prefix.
Assembly
Cake.AzureStorage.dll
Namespace
Cake.AzureStorage
Containing Type
AzureStorageAlias

Syntax

public static IEnumerable<string> DeleteBlobsByPrefix(this ICakeContext context, AzureStorageSettings settings)

Examples

Task("PackageAfterDelete")
 .Does(() => {
  var settings = new AzureStorageSettings();
  settings.AccountName = "AccountName";
  settings.Key = "API KEY";
  settings.ContainerName = "ContainerName";
  settings.BlobName = "PrefixToSearchBy";

  var deletedLog = DeleteBlobsByPrefix(settings);
  foreach (var line in deletedLog){
    Information(line);
  }
  
  settings.BlobName = "NameToUploadAs";
  var filePath = new FilePath("./location/of/file/to/upload");
  UploadFileToBlob(settings, filePath));
});

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The context.
settings AzureStorageSettings Azure Storage Settings.

Return Value

Type Description
IEnumerable<string>