Recently Windows 10 IoT Core Build 14393 is coming, but still without PiCamera support, WTF. So I can only choose Linux for my project. When I was using Windows, I use C# + Azure SDK to upload photos to Microsoft Azure. So how to do it on Linux?

After some research, here's how to do it.

My system is Raspbian Linux. First, we need to install Azure SDK in SSH Terminal:

sudo pip install --pre azure

Remember to execute the command as "sudo". Or you will not have permission to install it.

After installation, Python will support Azure. You will need an Azure storage account, such as mine, called "edirpi3", with a container named "webcamupload" in it.

Then, create a new py file:

sudo nano testazureblob.py

Acccessing Azure Container from python:

from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name='edirpi3', account_key='YOURKEY')

the "account_name" and "account_key" is in your azure portal:

To upload file:

from azure.storage.blob import ContentSettings
block_blob_service.create_blob_from_path(
    'webcamupload',
    'firstblood.jpg',
    'image1.jpg',
    content_settings=ContentSettings(content_type='image/jpeg'))

To take picture:

import picamera

camera = picamera.PiCamera()
camera.capture('image1.jpg')

Integrate those two functions, we get the code for upload picture to Azure Blob:

from azure.storage.blob import BlockBlobService
from azure.storage.blob import ContentSettings
import picamera

camera = picamera.PiCamera()
camera.capture('image1.jpg')

block_blob_service = BlockBlobService(account_name='edirpi3', account_key='YOURKEY')

block_blob_service.create_blob_from_path(
    'webcamupload',
    'firstblood.jpg',
    'image1.jpg',
    content_settings=ContentSettings(content_type='image/jpeg'))

Execute python file with "sudo python":

If everything is good, you will be able to see the picture in Azure portal: