Git Product home page Git Product 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

Watchers

James Cloos avatar

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.