X

This site uses cookies and by using the site you are consenting to this. We utilize cookies to optimize our brand’s web presence and website experience. To learn more about cookies, click here to read our privacy statement.

Azure IoT Edge Part 1: Preparing Environment with Bash

Author: Kieran Maltz Posted In: Azure, Cloud, IoT

Recently, the SPR Milwaukee team sponsored THAT Conference in Wisconsin Dells. We also shared thought leadership during a speaking session, discussing Azure IoT Edge as a tool for deploying an intelligent edge in an Internet of Things software solution. This topic proved to be valuable to others beginning their own journey to an intelligent edge.

Throughout this four-part series, I will share how to set up a container using Bash to emulate Azure IoT Edge installed and running on Ubuntu using the Azure CLI for automation. Here’s what we’re trying to accomplish:

Environment Architecture Image

If you are using an operating system with Bash, the upcoming posts should work as long as Docker is installed and configured. If you are using Windows, the first part of this process is to install Windows Subsystem for Linux.

WSL Setup

  1. Open PowerShell as Administrator and enable Windows Subsystem for Linux using the following command
    1. Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Next, install Ubuntu from the Microsoft Store

Docker Setup

  1. Install Docker for Windows following the instructions on the Docker website
  2. After installing Docker, we need to make it available to our Ubuntu installation. Enable the Docker Remote API by going to the settings and checking the box labeled “Expose daemon on tcp://localhost:2375 without TLS”. This allows Ubuntu to use the Docker for Windows installation.

Ubuntu Environment Setup

  1. Install the packages needed to use a repository over HTTPS using the following command:
    • sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  2. Add the Docker GPG key
  3. Set up the repository to use Ubuntu in a Docker container
  4. Install Docker CE
    • sudo apt-get install docker-ce
  5. Finally, one last command to tell Ubuntu how to connect to Docker for Windows
    • echo “export DOCKER_HOST=localhost:2375” >> ~/.bash_profile

Now, your machine has been prepared to use Windows Subsystem for Linux. This will enable the next step for a generic container on Ubuntu running Azure IoT Edge. Upcoming parts in the series:

  • Azure IoT Edge Part 2: Configuring the Docker Container
  • Azure IoT Edge Part 3: Configuring the Docker Container with the Azure CLI
  • Azure IoT Edge Part 4: Configuring Deployment to Azure IoT Edge