Azure / azure-iot-sdk-c

A C99 SDK for connecting devices to Microsoft Azure IoT services
https://azure.github.io/azure-iot-sdk-c
Other
584 stars 739 forks source link

The version of the Provisioning API is not up to date #2575

Closed cecilia-barnhill-cubic closed 6 months ago

cecilia-barnhill-cubic commented 6 months ago

in the current version of the sdk, the prov api version is 2019-03-31 https://github.com/Azure/azure-iot-sdk-c/blob/6b7753837ee18d2198759aa625d99081e255248f/provisioning_client/inc/azure_prov_client/prov_client_const.h#L18

the latest version supported by the dps is 2021-06-01 https://learn.microsoft.com/en-us/rest/api/iot-dps/device/runtime-registration/register-device?view=rest-iot-dps-device-2021-06-01

This didn't seem to cause issues for certain types of certificates - the certs generated using the Microsoft certGen.sh were able to provision without issue, but upon switching to production certificates, we received the below json: {"errorCode":401002,"trackingId":"701c9c8f-e467-47d8-8a01-c805a19ab22a","message":"Unauthorized","timestampUtc":"2024-02-08T18:13:04.331944Z"} I was able to verify the api version impacted the response using curl and I updated the PROV_API_VERSION, rebuilt the sdk, and have our devices provisioning successfully.

ericwolz commented 6 months ago

2584

ericwolz commented 6 months ago

fixed in PR