How do you setup shared access signature with more

2019-07-23 19:32发布

问题:

Can you setup shared access signature with more than 1 year expiration to avoid setup calls in Windows azure?

var signature = blob.GetSharedAccessSignature(new SharedAccessPolicy()
        {
            SharedAccessStartTime = null,
            SharedAccessExpiryTime =
               DateTime.Now.AddMinutes(expireMinutes), //expire time is restricted at azure to 1hr
            Permissions = SharedAccessPermissions.Read //readonly for now
        });

It does not let me set more than 1 hr.

回答1:

Those kinds of Shared Access Signatures have a maximum duration of one hour to minimize the impact of a leak (because they can't be revoked). You want a "container-level access policy" to set a longer (or infinite) expiration, and those can be revoked at any time.



标签: azure blob