问题
I am trying to set a shared access policy so that the user has infinite SharedAccessExpiryTime. I will track their access policies so that they can be revoked if needed.
From this thread, the answer states there is a mechanism for setting an infinite expiration time. I did some searching and was not able to find this, how can this be done?
Currently, I simulate infinite by providing some large values for expiration time:
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
SharedAccessExpiryTime = DateTime.UtcNow.AddYears(500),
Permissions = SharedAccessTablePermissions.Add
| SharedAccessTablePermissions.Delete
| SharedAccessTablePermissions.Update
| SharedAccessTablePermissions.Query
};
回答1:
In the Spring 2012 release that went out a few weeks ago, there were updates announced to Shared Access Signatures. For blobs, the 1-hour SAS limit has been lifted. The MSDN article is here, which includes quite a bit of sample code spanning SAS for queues, tables, and blobs.
来源:https://stackoverflow.com/questions/11216819/how-to-set-infinite-shared-access-signature-policy-in-azure