I'm trying to check on the expiration date of the SAS key on the client side so that I can request a new SAS key once it expires. I'm using the Microsoft.WindowsAzure.Storage
namespace (which is version 2.0 of the azure storage library). Is there a built in method for this or will I have to parse it manually?
I don't believe there's anything specific in the storage client library. You should be able to parse the querystring on the URI and look at the UTC date in signedexpiry
. You can parse the querystring with HttpUtility.ParseQueryString()
.
Here are two caveats to think about:
signedexpiry
will be part of the querystring. More on shared access policies here.David's answer is correct for the question about how to parse the expiry time (+1). But ultimately you should not be doing this. There are two better options:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With