How to control Raspberry Pi from Azure

Matthew Ferrie 51 Reputation points
2023-02-26T15:39:47.2733333+00:00

How do I set up my Raspberry Pi and Azure to be able to control the Pi remotely through Azure?

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
525 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,093 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde 27,186 Reputation points MVP
    2023-02-26T17:44:23.54+00:00

    Hello @Matthew Ferrie ,

    you can use the Azure IoT Hub to ingest telemetry from this Raspberry PI device and send the messages to other Azure resources.

    You can start with Azure IoT within moments but it takes time to create a complete solution (as with any architecture). Here, I highlight the most important ways to start.

    Using the IoT Hub, you can even send messages/commands/desired state back to the device using the 'Device Twin'.

    There are two ways to connect your device to the cloud:

    1. Write an application and run it on the device. Use the Azure IoT Device SDKs for an easy connection.
    2. Make use of Azure IoT Edge where you deploy the local logic as docker containers

    Note: In both solutions, you can use any programming language like NodeJS, C#, C, Jave, Python, etc.

    I recommend Azure IoT Edge because you no longer need to touch the device while updating your app after deploying the runtime.

    Microsoft also provides the Azure IoT PaaS resources as a complete SaaS solution: Azure IoT Central.

    Keep in mind, you control the application running on your device.

    If you want to control the device itself, check out OSConfig, useful for managing network settings, hostnames, time zones, security benchmarks, firewall rules, ssh users, and so on.

    Azure also supports device updates, a service that enables you to deploy over-the-air updates for your IoT devices.

    Again, take some time to learn about the Azure IoT ecosystem.

    There are many free learning Azure IoT modules and learning paths on MS Learn.

    I recommend to start with:

    So, do the following steps:

    • Create an Azure subscription
    • Create an IoT Hub
    • Decide if you want to create an Azure IoT device application or roll out Azure IoT Edge on your device
    • Register the device accordingly (so you have the right credentials. A connectionstring is good enough for development)
    • Create and deploy the logic

    Have fun!


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful