We are using Azure File Shares (File shares, not GPV2, meaning we're not using blobs or queues, just File Shares) to store our files.
We need to check if a list of file paths exist of not.
Is there a "bulk" version of ShareFileClient.ExistsAsync
?
What's the best workaround otherwise ?
We tried calling Exists
on each path, each call in it's own task, but it takes too long to return (for 250 paths it takes around 25 seconds):
var tasks = paths.AsParallel().Select(p => Task.Run(() =>
{
// share is a captured variable of type ShareClient
var dir = share.GetDirectoryClient(GetDirName(p));
var file = dir.GetFileClient(GetFileName(p));
var result = file.Exists();
return result.Value;
}));