I need to list all files from a specific directory from "Test" folder, EXCLUDING "Test2". I tried using "test" as prefix but it returns both folders.
Container: "myContainer"
TEST:
- file1.jpg
- file2.jpg
TEST2:
- file1.jpg
I tried the following but it returns both folders and path with output:
- Test/file1.jpg
- Test/file2.jpg
- Test2/file1.jpg
can I return the file ONLY instead of the path?
file1.jpg
file2.jpg
var blobUri = new Uri($"https://{myAccountName}.blob.core.windows.net/"); StorageSharedKeyCredential credential = new StorageSharedKeyCredential(myAccountName, myKey); BlobServiceClient service = new BlobServiceClient(blobUri, credential); BlobContainerClient container = service.GetBlobContainerClient("myContainer"); AsyncPageable<BlobItem> blobs = container.GetBlobsAsync(prefix: "test"); List<Result> results = new List<Result>(); await foreach (var blob in blobs) { var result = new Result(); result.FileName = blob.Name; results.Add(result); }