Programmatically regenerate keys for group enrollments in Azure Device provisioning Service (DPS)

Mirza Haad Baig 1 Reputation point

I want to programmatically regenerate the symmetric key (primary and secondary keys) in group enrollments of Azure DPS. There is an API provided by azure in the link. I used the API but it returned 404 not found about which I could not figure out its reason. Link of API:

I also found a github repo and was able to was able to get the instance of an enrollment group by running it. Now I want a way to regenerate the keys for current group but there is seem to have no function that would allow that thing. A way is to change the redo attestation that in return will change the symmetric keys but I have not find a way yet. Link of repo:

If anyone could help me, that would be great.

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
255 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
166 questions
Azure IoT Device Provisioning Service
Azure IoT Device Provisioning Service
A helper service for Azure IoT Hub that enables zero-touch, just-in-time provisioning to the right IoT hub without requiring human intervention.
91 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dom 1,211 Reputation points Microsoft Employee

    There's no API specifically for regenerating group enrollment keys. However, you can use the CreateOrUpdateEnrollmentGroupAsync method to update an existing enrollment group, passing in a new set of keys. See: You will need to generate your new symmetric keys to pass in as part of the EnrollmentGroup parameter.

    The following sample shows an example of using this method with an enrollment group that uses X.509 certs, but you should be able to easily modify it to use symmetric keys instead: