1

I have the following situation:

I have an application that collects some data from some sensors. The app is written in C++. I need some way to send data (blobs) to the Windows Azure Storage. The data will be processed by some central server elsewhere. I am just interested in sending the data (binary stream). Is there a way to connect from my native app to Azure? Do I need a Web Role ?

Thanks, Tamash

Tamas Ionut
  • 4,240
  • 5
  • 36
  • 59
  • You can also check http://stackoverflow.com/questions/9202092/access-azure-blob-storage-using-c and http://stackoverflow.com/questions/8471810/accessing-azure-storage-tables-from-c-code - similar questions, where I also posted a link to open source C++ libraries that you can use to wrap the REST API calls. – astaykov Apr 01 '12 at 11:03

2 Answers2

5

You can do this. Windows Azure Blob Storage is accessible via a language-independent REST API.

Note that there are some more directly supported language SDKs that simplify the REST API interaction (retries, HMAC signing, etc), but it is entirely doable from C++.

Whether you need a Web Role (or Worker Role) for this depends on one thing: Is the sensor-collection application running on a system that can be trusted with the "keys" needed to access Windows Azure Blob Storage. If that app host can be trusted (e.g., fully under your control, not running on a customer's or partner's desktop for example) then it might be fine to fully trust it with unfettered access to your storage account. Then the sensor-collection app can beam the data directly into blob storage - no Web Role needed.

If you cannot trust the host on which the sensor-collection is running, you need another tact. There is a way for a client to request temporary, limited-scope access to blob storage. This is known as Shared Access Signatures (SAS) in Azure/Blob terminology. A client in possession of an unexpired SAS can do whatever is allowed by that SAS - such as writing to blob storage. To create a SAS, one needs the storage keys mentioned in the prior paragraph. This would be a reason to deploy a Web Role - it can generate the SAS for you as needed (via a web service of your creation, for example). The scheme for identifying trusted clients depends on how you do things (the sensor-collection app instances need to identify themselves in some trusted way, I assume -- but the SAS issued to one instance can let it write into an area in blob storage dedicated to that app instance, account, customer, site, etc. - whatever the right abstraction is for your business).

Note, though, that while a Web Role is a way to solve the SAS-creation, you could also do it from any code that has access to a storage key.

codingoutloud
  • 2,115
  • 19
  • 21
3

Not sure if you are still interested in accessing Azure storage with C++, but the Microsoft team has been working on this for the last several months. Check out the Casablanca libraries on DevLabs.

http://msdn.microsoft.com/en-us/subscriptions/casablanca.aspx

Sana
  • 181
  • 1
  • 3