Mohit Singh
Mohit Singh

Reputation: 477

Can we Reset SAS Url for azure blob storage?

How to create SAS url for azure blob storage using java How to generate azure blob storage SAS url using java?

do we have any api where i can expire any existing sas url?

Requirement: Generate any sas url with expiry time as 7 days and i want some api where i can reset this sas url at any point of time within expiry time limit.

but looks like we don't have this i guess and every time it will create new sas url but we can expire any existing sas url at any point of time.

Upvotes: 0

Views: 1116

Answers (1)

NotFound
NotFound

Reputation: 6157

You can create an access policy on the container with set start and end date. Then create a SAS token on the container or an individual blob using that policy. Once the policy is deleted it will also invalidate all SAS tokens that were generated with it.

public BlobServiceSasSignatureValues(String identifier)
//Where identifier is the name of the access policy

It's limited to 5 access policies on a table, but if you are a bit flexible on the expiration date you could make one each week, so every blob would be available for at least a week and up to two at most. It also implies that once you remove the policy all url's for that week no longer work.

I don't think there's any other way you are able to invalidate the generated url's apart from generating new accesss keys.

Upvotes: 0

Related Questions