This project demostrates the capabilities of Azure IoT Hub and how IoT devices and IoT edge integrate with IoT Hub. Moreover, it highlights a CI/CD pipeline for IoT module from development to deployment.
-
Visual Studio Code configured with Azure IoT Tools
-
Azure CLI with latest IoT extension
-
Fork this repo and clone your forked repo locally
-
Run
AZ_SUBSCRIPTION_ID={Your-Azure-subscription-id} AZ_BASE_NAME={Unique-base-name} ./build_environment.sh
to build Azure environments- This will provision an Azure IoT Hub, Azure Linux VM with IoT Edge runtime, and Azure Container Registry
-
Use VS code to open current directory
- Create new file
IoTEdgeSolution/.env
. Copy below content to env file
CONTAINER_REGISTRY_USERNAME={your-container-registry-username} CONTAINER_REGISTRY_PASSWORD={your-container-registry-password} CONTAINER_REGISTRY_ADDRESS={your-container-registry-address} BUILD_BUILDID=1
- Replace the value of
azureContainerRegistryName
andazureIotHubName
(line 8 and 9) with your respective resource names - To link Azure account and Azure IoT Hub to VS code, follow steps in the section "Set up VS Code and tools"
- To build and push IoT modules, follow steps in the section "Build and push your module"
- To deploy IoT modules to edge devices, follow steps in the section "Deploy modules to device"
- To edit module twin, follow steps in the section "Edit the module twin"
- Create new file
-
Create new Azure DevOps service project
- Create new "Azure Resource Manager" service connection named
AzureSubscriptionServiceConnection
and link it to your Azure subscription - Create new Azure Pipeline using your forked repo and YAML file
./azure-pipeline.yml
- Create new "Azure Resource Manager" service connection named
- [] document steps to reproduce environment
- [] implement environment promotion
- GitHub Action currently does not support Azure IoT Edge plugins
- Tutorial: Develop IoT Edge modules for Linux devices
- Tutorial: Develop and deploy a Node.js IoT Edge module for Linux devices
- GitHub: Azure IoT Edge sample project for NodeJS
- No warranties or guarantees are made or implied.
- All assets here are provided by me "as is". Use at your own risk. Validate before use.
- I am not representing my employer with these assets, and my employer assumes no liability whatsoever, and will not provide support, for any use of these assets.
- Use of the assets in this repo in your Azure environment may or will incur Azure usage and charges. You are completely responsible for monitoring and managing your Azure usage.
Unless otherwise noted, all assets here are authored by me. Feel free to examine, learn from, comment, and re-use (subject to the above) as needed and without intellectual property restrictions.
If anything here helps you, attribution and/or a quick note is much appreciated.