/// <summary>Get a list of All blobs in the specified contaier</summary> /// <param name="containerName">container name</param> /// <returns>A list of blob names</returns> /// <remarks>Still need to determine what we need back for each blob</remarks> public List <string> ListBlobs(string containerName, string pattern = null) { List <string> blobs = new List <string>(); // blob container name - can we set a default somehow if (String.IsNullOrWhiteSpace(containerName)) { return(new List <string>()); } // Get a reference to a share and then create it BlobContainerClient container = new BlobContainerClient(this.ConnectionString, containerName); // check the container exists Response <bool> exists = container.Exists(); if (!exists.Value) { return(new List <string>()); } Pageable <BlobItem> results = null; if (String.IsNullOrWhiteSpace(pattern)) { results = container.GetBlobs(); } else { results = container.GetBlobs(prefix: pattern.Trim()); } IEnumerator <BlobItem> enu = results?.GetEnumerator(); while (enu.MoveNext()) { blobs.Add(enu.Current.Name); } ; return(blobs); }