Talel BELHAJSALEM
Talel BELHAJSALEM

Reputation: 4294

Is there a way to set device tag in iotedge config file for DPS?

I have an iotedge device that has x509 DPS activated perfectly.

I also have a Deployment that holds 3 docker images ready for deployment for any device with a specific tag.

When I need to deploy that to my device, after DPS, I need to edit tags manually in my shown device, then the deployment will be triggered for my device.

Is there a way to tell iotedge to provision my device with my tag? So the result would be a full automated DPS and deployment ?

This is my /etc/iotedge/config.yaml file:

agent:
  config:
    auth: {}
    image: mcr.microsoft.com/azureiotedge-agent:1.1
  env: {}
  name: edgeAgent
  type: docker

connect:
  management_uri: unix:///run/iotedge/mgmt.sock
  workload_uri: unix:///run/iotedge/workload.sock

homedir: /data/iotedge
hostname: xxx

listen:
  management_uri: unix:///run/iotedge/mgmt.sock
  workload_uri: unix:///run/iotedge/workload.sock

moby_runtime:
  uri: unix:///var/run/docker.sock

provisioning:
  always_reprovision_on_startup: true
  attestation:
    identity_cert: file:///opt/xxx/dps/xxx.cert.pem
    identity_pk: file:///opt/xxx/dps/xxx.key.pem
    method: x509
    registration_id: xxx
  dynamic_reprovisioning: false
  global_endpoint: https://global.azure-devices-provisioning.net
  scope_id: xxx
  source: dps

Thanks.

Upvotes: 0

Views: 154

Answers (1)

Mark Radbourne
Mark Radbourne

Reputation: 643

The DPS allows you to push tags to a device when it enrolls. These are specified as part of the enrollment set up. If you have a IoT Edge deployment that matches those tags then it should push the modules in that deployment to the Edge device when it first connects.

This is theory. I have never tried it.

Upvotes: 0

Related Questions