I have a piece of code which iterates over file share and delete the file share, while deleting it may contain snapshots ,how do I delete file share as it keeps failing with Error Message like . "Unable to delete file share because one or more share snapshots have active leases, Note: I could not see any properties letting me know lease ID and even snapshot time is null .Over Portal there is a delete lock at storage account level ,does it restrict the deletion of file shares ?
using Microsoft.WindowsAzure.Storage
string storageconnectionstring = "Storage Account connection string";
CloudStorageAccount c = CloudStorageAccount.Parse(storageconnectionstring);
CloudFileClient fileclient= c.CreateCloudFileClient();
foreach(var x in fileclient.ListShares()) {
x.DeleteIfExists(DeleteShareSnapshotsoptions.IncludeSnapshots ,AccessCondition.GenerateEmpty(),
new FileRequestOptions(), new OperationContext())----> This code is failing
}