What is Azure IoT Edge?
Azure IoT Edge is a fully managed service which allows you to deploy Edge modules directly onto Edge devices without writing a single line of code. What's the use of Azure IoT Edge Runtime on VM? Using VM allows creating simulated edge device which is very useful for testing. This allows testing workloads without even having the real hardware.
How does Azure IoT Edge work on Ubuntu VM?
When the VM is booted first, the latest runtime of Azure IoT Edge gets installed. Using this approach, this is always ensured that the runtime is always running on the most secure environment containing all the latest fixes. Using command line or Azure Portal, the connection string used for connecting to Azure IoT Hub can be set by running the automated scripts which come packaged with Ubuntu VM.
Let’s Get Started
You can spinoff the Azure IoT Edge for Ubuntu VM using Portal/CLI. However, if you are a beginner, it’s recommended that you use a Portal based approach and later CLI for scaling up.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Access the Marketplace
Access the Marketplace using https://bit.ly/2HBID5Y
Step 2: GET IT NOW
Click on GET IT NOW.
Step 3: Continue
Click on Continue.
Step 4: Azure Portal
In the Azure Portal now, click on Create.
Step 5: Entering the Details
Give a proper name to VM. For authentication type, choose a password as this dev environment, however, for a production environment, it is recommended that SSH public key is used. For selecting a VM size, the server does not need to be very powerful as we are simulating an edge IoT device similar to Raspberry Pi. So, select the smallest VM from the server option.
Step 6: Click on Review+Create
Once, the validation passes, you are shown the final screen for review. Click on Create. Once your VM is deployed, you need to configure the connecting string obtained from Azure IoT Hub. For this purpose go to your Azure IoT Hub. Select IoT Edge under Automatic Device Management.
Step 7: +Add an IoT Edge Device
Click on +Add an IoT Edge Device. In the next screen, enter the Device ID and leave other fields as they would be auto-generated later as Auto-generated keys checkbox is selected by default. Click on Save.
Step 8: Copy Connection String
Now, once the device is created, open it back again to copy the connection string.
Step 9: Open Your Edge VM
Now, go to your Edge VM which you recently deployed. You can search for your VM on the top of the Azure portal using the search option.
Step 10: Run Command
Once, you are able to open VM, next, under Operation command, click on Run Command.
Step 11: Run the RunShellScript
Next, click on RunShellScript which will open the terminal for running the script. Execute the script below via the command window with your device connection string:
Step 12: Run
Click on Run. Wait for few mins until this gets completed. Once this gets completed, you have connected your Edge device to IoT Hub. You can explore the marketplace to select the various available edge modules to deploy further.