Code Monkey home page Code Monkey logo

azure-iotedge-blobstorage-sample's Introduction

page_type languages products description
sample
csharp
azure
azure-iot-edge
Simple sample showing how to use local blob storage with Azure IoT Edge.

Azure IoT Edge Blob storage sample

Simple sample showing how to use local blob storage with Azure IoT Edge that's GA since August 2019.

The sample will deploy 3 custom modules on the edge device

  1. The Blob storage module (to be able to write blobs to local storage of the edge device)
  2. A custom developed module called 'BlobWriterModule' that uses the Blob storage module to write messages from the pipe in single blobs on the edge device
  3. The Microsoft Temperature simulator module that generates messages that will be forwarded to the custom developed module

After deploying the modules to an edge device, messages from the Temperature simulator module will be forwarded to the BlobWriterModule that will store each message as a blob on the local blob storage with the name 'MessageContents_Timestamp.txt'(E.g. MessageContents_2018-11-05T115112.txt) and with a contents like this

{"machine":{"temperature":21.869028476937224,"pressure":1.0990032442080382},"ambient":{"temperature":21.113945195737269,"humidity":25},"timeCreated":"2018-11-05T11:51:12.7848955Z"}

You can also access the local Blob storage with the Azure Storage Explorer by using the following Connection string (assumes usage of an Azure VM for the edge device in West Europe data center region):

DefaultEndpointsProtocol=http;BlobEndpoint=http://<DNS name>.westeurope.cloudapp.azure.com:11002/metadatastore;AccountName=metadatastore;AccountKey=<Your configured account key>

Configuration

This sample was developed with Visual Studio Code and uses the Azure IoT Edge extensions. Therefore most of the configuration is stored in the 'deployment.template.json' file.

Local storage for Blobs on the edge device

  • Docker volume for Blobs: blobvolume : Configured in the create Options of the 'blobstoremodule' module
  • Storage account name: metadatastore : Configured in the create Options of the 'blobstoremodule' module
  • Storage account key: Not shown here : Base64 string in the create Options of the 'blobstoremodule' module
  • Blob storage connection string: Not shown here : Env variable defined in the create Options of the 'BlobWriterModule' module
  • Container name for message blobs: samplecontainer : Env variable defined in the create Options of the 'BlobWriterModule' module

Private registry for the custom developed module

Create an '.env' file at the first folder level and add the information about your private registry for the image

mycontainers_username=<Put in your username for your private registry>
mycontainers_password=<Put in your password for the private registry>
mycontainers_address=<Put in your address for the private registry>

Tips

For further tips see the official documentation.

azure-iotedge-blobstorage-sample's People

Contributors

jmayrbaeurl avatar luyunmt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-iotedge-blobstorage-sample's Issues

facing issue with blob upload module in Nested Edge

Hi,

facing issue in blob storage upload module.
Following the instructions at https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-blob?view=iotedge-2020-11

attaching the error in log-
x-ms-client-request-id:21f8d1b4-d620-4685-9e04-41209ad83b52
x-ms-date:Wed, 14 Jul 2021 15:23:24 GMT
x-ms-version:2020-04-08
/edgestore/edgestore
restype:container'.
---> Microsoft.Cis.Services.Nephos.Common.Authentication.AuthenticationFailureException: The MAC signature found in the HTTP request 'C/TsG70dzNihXP27wckXUGx/5ZII+MbTnk8o5kt2Oe4=' is not the same as any computed signature. Server used following string to sign: 'PUT

bob_upload_error.txt

Device Information
Host OS [e.g. Ubuntu 18.04, Windows Server IoT 2019]: Ubuntu 18.04
Architecture [e.g. amd64, arm32, arm64]: amd64
Container OS [e.g. Linux containers, Windows containers]: Linux
Runtime Versions
aziot-edged [run iotedge version]: 1.2.3
Edge Agent [image tag (e.g. 1.0.0)]: 1.2
Edge Hub [image tag (e.g. 1.0.0)]: 1.2
Docker/Moby [run docker version]: 20.10.7+azure
Note: when using Windows containers on Windows, run docker -H npipe:////./pipe/iotedge_moby_engine version instead

Does it support append blobs when in iotedge?

Hi,

I found the I can't use append blobs in my program or using Microsoft Azure Storage Explore.

The image of module is from "mcr.microsoft.com/azure-blob-storage:latest".

It is clear that "this module does not support page blobs" in the Web page.

image

So , append blobs as same as page blobs that can't be supported in this module?

Thx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.