How to set CORS properties for BLOB Storage using node? RRS feed

  • Question

  • Hi - I just got started with Azure using a Node-based web site and mobile services.

    I am following various documentation in order to provide an API for users to upload images via a time-restricted SAS for the BLOB Storage.

    In order to upload my image, I need to set the CORS configuration for the BLOB Storage. Unfortunately this cannot be done via the management portal.

    I'm unclear as to how to accomplish this. I'm considering using the startup.js file in my mobile service to make a post request to the BLOB Storage REST API:


    Are there appropriate methods in the Node SDK to make this easier, especially the signing part?

    What is the recommended way for setting CORS properties for the BLOB Storage via Node?

    Thanks for your help


    • Edited by ewstefan Monday, February 17, 2014 5:13 PM
    Monday, February 17, 2014 4:59 PM


All replies

  • Unfortunately Node SDK does not support CORS functionality yet. Your option would be to write code which consumes the REST API for setting CORS. Not sure if it helps but there's a free tool out there written by my company which you can use to set CORS on your storage account. More information about this tool can be found here: http://blog.cynapta.com/2013/12/cynapta-azure-cors-helper-free-tool-to-manage-cors-rules-for-windows-azure-blob-storage/

    Hope this helps.

    • Marked as answer by ewstefan Tuesday, February 18, 2014 9:36 AM
    Tuesday, February 18, 2014 3:26 AM
  • Thanks Gaurav. This may get us going. Eventually, I think we should have the configuration in the startup code so we can ensure all properties of the app are programatically set based on the environment, without the need to run additional tools.

    Tuesday, February 18, 2014 9:35 AM
  • While still trying to figure out how to do this in Node, I ran into some road blocks with creating the signature - documented here:


    Wednesday, February 19, 2014 8:23 AM