IOT device authentication with ACR

Andy Doan 1 Reputation point
2022-02-14T20:31:28.59+00:00

I'm looking to have a fleet of IoT devices that need pull access to a private Azure Container Registry. I'm trying to determine the recommended approach to having them do a docker login or docker-credential helper. I've created an IoT hub and have a device connecting using an x509 cert. I'm hoping there's some way I can leverage that identity to somehow authenticate with ACR. This shared access policy and token service looks like it might help:

https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-dev-guide-sas?tabs=node#authenticating-a-device-to-iot-hub

but I can't quite connect the dots.

I'm new to Azure so I'm struggling to articulate this well. Basically, I'm trying understand if there is an Azure equivalent to something like:

https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/

thanks

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
379 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 28,386 Reputation points MVP
    2022-02-14T23:24:31.51+00:00

    Hello @Andy Doan ,

    Azure IoT (Edge) devices can create a secure connection using e.g. a connection string or an x509 certificate.

    The docker credentials to non-public container repositories, used by edge devices are not managed by these device credentials.

    Azure IoT edge devices, once the runtime starts and a secure connection is set up, will ask for a deployment manifest using an outbound connection.

    This document (it's just a JSON structure) describes which Docker containers must be deployed on the device, which docker container create options must be used, any 'desired properties' assigned to each module.

    The deployment manifest can also contain the credentials needed for one or more private registries:

    174147-image.png

    The credentials are stored plain text in the deployment manifest but this manifest is not accessible once entered in the Azure IoT Device registration. Normally, this is automated with scripts so the chance of leaking credentials is minimal.

    I can recommend this free learning path all about Azure IoT Edge.