Hello @Rakesh S , Thanks for posting this query over here. Below is the 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 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 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.
{
"attestation": {
"type": "x509",
"X509": {
"clientCertificates": {
"primary":{
"certificate":"base64 string of your cert"
}
}
}
},
"registrationId":"testenrollment10",
"capabilities":{"iotEdge":false},
"provisioningStatus": "enabled"
}
Please leave your comment below to this response if you need further help in this matter.