I am doing operations on azure DPS via REST apis. I am able to post a new provision successfully in "Create new individual enrollment", via REST API.The Url is used is, "https://name.azure-devices-provisioning.net/enrollments/registrationId?api-version=2019-03-31";. My current task is to update the certificate for an individual enrollment in DPS. I am extracting the body of the certificate and attaching it to the request body and doing the PUT operation. But I am getting an error saying "Enrollment already exists with different cert info". I am providing the content-type and authorization sas token as headers. And in request body, I am passing the eTag along. I guess I have cleared all the pre-requisites for an update operation. Please help me to understand if I am doing something wrong here. Thanks in advance!
Update certificate for an individual enrollment in azure DPS via REST API
471 Views Asked by Rakesh S At
2
There are 2 best solutions below
2
Anush
On
For updating the individual enrollment in DPS you also have to add the etag value in the request header. The header property name for this is If-Match. For details see https://learn.microsoft.com/en-us/rest/api/iot-dps/createorupdateindividualenrollment/createorupdateindividualenrollment#request-headers
Related Questions in AZURE-IOT-HUB
- IoT Hub Equivalent For IoT Central Offline commands
- Alternatives for azure-iot-hub python package
- Azure Device Update for IoT Hub & Deployment
- How to retrieve IotHub usage information inside Azure Function
- Upload device's x509 certificate to Azure Iothub
- Too many requests error while creating scheduled jobs in IOT central create job API
- 'Too many requests' error on Azure IOT central create job API
- After updating a reported property, attempting to fetch it returns the previous version, not the latest one in Azure Module Client
- Azure Data Manager for Agriculture - Sensor Telemetry Data
- Connecting to RabbitMQ with Azure IoT Hub Device client
- MQTT: Connection to Azure IoT Hub (Micropython)
- AT Commands to send/publish data to azure iot hub using sim808
- Couldn't get IoT Central offline command to work
- Azure IoT DPS - Enrollment Group - Create Or Update - Rest API
- How do I use Azure IoT SDK (C#) to develop code to send data from my robotic arm to my IoT hub?
Related Questions in AZURE-IOT-EDGE
- Get Eflow status from a remote machine via ssh and python: does not execute powershell command
- Turn .Net 6 Background Service app as IoT Edge Module
- Problem with running Azure spatial-analysis container
- After updating a reported property, attempting to fetch it returns the previous version, not the latest one in Azure Module Client
- Azure IoT DPS - Enrollment Group - Create Or Update - Rest API
- Azure IoT Edge. Module Twin Configuration. Create a target condition based of device twin tags?
- IotEdge eFlow: copyEflowVMFile raises errors in Vsock
- Device troubleshooting tools
- GPIO / System.Device.Gpio / RegisterCallbackForPinValueChangedEvent / Rising and Falling Continuously with circuit closed
- IOT Edge for Linux on Windows (eflow) - nested VM deployement - proxy settings - corporate firewall
- How to send tool data from telemetry Azure IoT Hub to Azure Functions?
- Environment variable IOTEDGE_WORKLOADURI is required in Java azure IoT SDK using ModuleClient Class
- Using iotedgehubdev generated iothub modules don't run locally due to "repository name must be lowercase"
- MS IotEdge eFlow: Connect-EflowVM error - wants password
- How to debug IOT edge modules running as Linux containers from Visual studio
Related Questions in AZURE-IOT-DPS
- Get Azure deviceProvisioning Service EnrollmentGroupKeys programatically C#
- Azure IoT DPS - Enrollment Group - Create Or Update - Rest API
- Azure sdk receiving different error messages while trying to connect to IotHub when device is disabled
- Azure IoT Device Provisioning Service – Device Registrations C# SDK – “CA certificate not found”
- How Achieve AWS MQTT topics in azure IoT and what is the work around for the similar functionality
- Connect to Azure DPS group enrollment x509cert Linux
- Device provisioned with DPS always shown as "X509 self-signed" instead of "Certificate Authority"
- How can DPS use Managed Identity to authenticate access to my Azure Function?
- HTTP CONNECT to an Azure DPS Endpoint through proxy failing
- Is there a way to set device tag in iotedge config file for DPS?
- Same X.509 in Azure APIM and IOT DPS
- Azure IoT Device Provisioning Service: Empty Logs
- Azure C SDK sample device provision program unauthorized connection
- Device Provisioning via Enrollment group
- How IoT Hub cryptographically validates the certificate chain?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
We can start by step by step process where I have successfully updated my x509 certificate with Azure DPS via REST API call. I hope this helps with your query.
Step1: Create the Individual Enrollment with the x509 certificate, pass it in base64 format. Please make a note of the 'eTag' value in the response.
Verify In the Azure DPS portal. I see the thumbprint matches my x509 certificate.
Step 2: Now time for updating the existing Enrollment with a new certificate. use the base64 format. use the "If-Match" in the request header and the value is the "eTag" obtained/copied from the previous step.
Below image shows the Request Header with the "If-match =eTag" for updating the existing entity.
Finally, we can see the response is a success for the update operation.
Verify In the Azure DPS portal. I see the thumbprint matches my new x509 certificate.
Sample Request body, in case, if it is useful to anyone.
Please leave your comment below to this response if you need further help in this matter.