The blob and table stores can accept http REST traffic for uploads, but you need firmware with SHA2 and MD5 available in order to compute the required signatures for the headers.
I am working to build new Molecule.Net firmware with the needed crypto functions (because I need it too for Azure and for faster onboarding crypto). I believe some GHI firmware has the crypto and some doesn’t, but I haven’t tried it on my Spider or Cerbuino.
@ njbuch - Another option would be to create an AzureWebsite. Upload images to the website, and then have the website (which will have security and encryption available) upload the document to Azure Blob Storage. We work with Azure blob storage daily at my work and have lots of c# code that I could share if you like.
There is a great SDK for Azure blob storage and lots of great examples.
My interest is in serial wifi of course, so I have been preparing a serial wifi version of the Azure Storage libs. The protocol libs are almost done, but the security lib (which is also used in the wifi onboarding) is ready.
Example of use: Results verified against desktop crypto.
using System;
using System.Text;
using Microsoft.SPOT;
using PervasiveDigital.Security.ManagedProviders;
namespace MFHashValidation
{
public class Program
{
public static void Main()
{
var keyBytes = Encoding.UTF8.GetBytes("myAzureAccountKey");
var canonicalizedHeaderBytes = Encoding.UTF8.GetBytes("stringToHashGoesHere");
var hmac = new HMACSHA256(keyBytes);
var hash = hmac.ComputeHash(canonicalizedHeaderBytes);
}
}
}
Yes, that’s actually where I am testing - with Oxygen+Neon. It is useful on any platform that does not have the Crypto module in the firmware or enough memory for the full System.Cryptography assembly.
@ njbuch - which library do you mean? The netmfazure one? I didn’t know about the netmfazure lib until just now, though now that I do know about it, I will probably borrow some pieces from it. The security package I just posted is not from netmfazure, but I may borrow some of the http helpers from the netmfazure source just to save time now. They’ll all be twiddled a little bit for serial wifi and packaged as nuget packages.
This is pretty green (new) code, and I am sure there will be bugs (I have a couple on my list already). But anyway, I have added a PervasiveDigital.Net.Azure.Storage package to nuget which you can use with serial wifi interfaces to interact with Azure Storage services.
Use it like this:
[ol]Start a new project
Add nuget packages:
For Molecule.Net : IngenuityMicro.Hardware.Neon and PervasiveDigital.Net.Azure.Storage
For all others : PervasiveDigital.Hardware.ESP8266 and PervasiveDigital.Net.Azure.Storage[/ol]
Then use something like this (this is for blobs - tables and queues will come in a couple days as will some blog posts with more usage details and examples.
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.IO.Ports;
using IngenuityMicro.Hardware.Neon;
using IngenuityMicro.Hardware.Oxygen;
using PervasiveDigital.Net;
using PervasiveDigital.Net.Azure.Storage;
namespace AzureBlobDemo
{
public class Program
{
public static void Main()
{
// For non-Molecule.net, it would be something like this...
//var wifi = new Esp8266WifiDevice(new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One), new OutputPort((Cpu.Pin)19, false), null);
// For Molecule.net:
var wifi = new NeonWifiDevice();
wifi.Connect("---------", "----------");
var sntp = new SntpClient(wifi, "time1.google.com");
sntp.SetTime();
var account = new CloudStorageAccount("youraccountnamehere", "PblOkty----------------youraccountkeyhere--------------------------------------------A==");
var blob = new BlobClient(wifi, account);
var containerName = "cont3";
// if needed...
//blob.CreateContainer(containerName);
var someBytes = new byte[256];
for (int i = 0; i < someBytes.Length; ++i)
someBytes[i] = (byte)i;
blob.PutBlockBlob(containerName, "mybytes", someBytes);
}
}
}
If you will be using a serial wifi adapter with it’s own TCP stack, then I would use the PervasiveDigital software.
In short, if you got your connection from System.Net, then use netmfazurestorage because it will use the NETMF TCP/IP stack. My PervasiveDigital solution is for folks that are not using the NETMF TCP stack.