How to set infinite shared access signature policy in azure?

淺唱寂寞╮ 提交于 2019-12-12 17:17:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!