0

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.

Talel BELHADJSALEM
  • 3,199
  • 1
  • 10
  • 30
  • hi device tags like ```twin.Tags["location"] = "Building A"; twin.Tags["temperature"] = "72F";``` can be added with c# code which will refelect in iot edge – Sampath May 12 '23 at 04:52
  • I able to update device tags with C# in [azure](https://i.imgur.com/Bg2kLpm.png) with the [code](https://i.imgur.com/cBvhJE5.png) with [output](https://i.imgur.com/qFv6O7W.png) in [azure](https://i.imgur.com/dAe5Ohf.png) – Sampath May 12 '23 at 05:40
  • Thanks for the comment, but in my case I let iotedge service do the provisioning, I am not doing it with any source code. – Talel BELHADJSALEM May 12 '23 at 08:15

1 Answers1

0

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.

Mark Radbourne
  • 528
  • 3
  • 12