I'm looking for a way to find any expired or expiring SAS signatures on an Azure storage account.
Using C# I have examined all the public properties and methods of the CloudStorageAccount class, I have also looked at this class in ILSpy and Azure Resource explorer - just can't see a way to retrieve the SAS expiry date/time.
void Main()
{
CloudStorageAccount account = new CloudStorageAccount(new
StorageCredentials(GetName(), GetKey()), true);
account.Dump();
CloudBlobClient client = account.CreateCloudBlobClient();
foreach (CloudBlobContainer container in client.ListContainers())
{
var sabp = new SharedAccessBlobPolicy();
var sas = container.GetSharedAccessSignature(sabp);
Console.WriteLine(container.Name);
Console.WriteLine(sas);
Console.WriteLine();
}
}
internal string GetName() {return @"myaccountname";}
internal string GetKey() {return @"myaccountkey";}
The is no error but also no way (I can see) to get the account-level SAS.
Note I do not want any blob SAS but the SAS set against the container.
Thanks