How to access Azure storage queue by JavaScript

。_饼干妹妹 提交于 2019-12-04 18:09:13

Yes, it is certainly possible. In fact, I am currently developing a service which does exactly this.

Step 1: Enable CORS for Queue Service

To accomplish this, first you need to enable CORS settings on your Queue Service. You may find this blog post useful for CORS settings: http://blogs.msdn.com/b/windowsazurestorage/archive/2014/02/03/windows-azure-storage-introducing-cors.aspx. You would have to make following settings:

Allowed Origin: Your domain name

Allowed Verbs: I would start with all the possible verbs but do take a look at REST API documentation for messages and see which operations you wish to perform and allow only those verbs.

Allowed Headers: *

Exposed Headers: *

Step 2: Get a Shared Access Signature for Queue

Next, you would need to create a Shared Access Signature (SAS) on a queue and set appropriate permissions. For setting up SAS on Queues, you could make use of Azure Storage Client library. You may find this blog post useful for learning more about SAS on Queues: http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-table-sas-shared-access-signature-queue-sas-and-update-to-blob-sas.aspx.

Step 3: Access your Queue

Once SAS URL is created, you can take that URL and start using it via jQuery/AJAX in your web application.

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