如何设置在蔚蓝无限共享访问签名政策? [英] How to set infinite shared access signature policy in azure?

查看:175
本文介绍了如何设置在蔚蓝无限共享访问签名政策?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个共享的访问策略,使用户拥有无限SharedAccessExpiryTime。我会跟踪他们的访问策略,使他们可以根据需要被撤销。

从<一个href=\"http://stackoverflow.com/questions/10135133/how-do-you-setup-shared-access-signature-with-more-than-1-year-expiration-at-azu\">this螺纹时,答案指出有用于设定一个无限期满时间的机制。我做了一些搜索,并没有能够找到这一点,这可怎么办呢?

目前,我模拟无穷通过为到期时间提供了一些大的值:

  SharedAccessTablePolicy政策=新SharedAccessTablePolicy()
        {
            SharedAccessExpiryTime = DateTime.UtcNow.AddYears(500),            权限= SharedAccessTablePermissions.Add
            | SharedAccessTablePermissions.Delete
            | SharedAccessTablePermissions.Update
            | SharedAccessTablePermissions.Query
        };


解决方案

在2012年春季发布的数周前就出去了,有宣布的共享访问签名更新。对于斑点,在1小时的SAS的限制已经解除。 MSDN文章是<一个href=\"http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-table-sas-shared-access-signature-queue-sas-and-update-to-blob-sas.aspx\"相对=nofollow>这里,其中包括相当多的样本code的跨越SAS为队列,表格和斑点。

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
        };

解决方案

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.

这篇关于如何设置在蔚蓝无限共享访问签名政策?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆