Azure Device provision service not connecting with latest 2023 SDK sample

Venkata Siva Prasad K 1 Reputation point

Hi Team,

We are currently trying to upgrade the device Azure IOT SDK C from 2020 version to latest 2023 LTS version. But We are getting connectivity errors with DPS. We are using provision multiple X509 device with enrollment groups.

So first we tried to check with sample solutions to identify the problem and use the same solution in device code.

In provision sample code we followed "Provision multiple X.509 devices using enrollment groups" tutorial and provided global provision URL and id_scope properly. And provided device certificate data and device private key. But with latest SDK we are not able to connect. With 2020 SDK it is able to connect DPS. I have attached two version screenshots Please help us to resolve this issue, is any major changes are done with latest SDK.? This samples are ran from my windows machine.



Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
173 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.
99 questions
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 3,956 Reputation points

    Hi @Venkata Siva Prasad K Greetings! Apologies for the delayed update. I have followed the Tutorial Provision multiple X.509 devices using enrollment groups to provision multiple devices with Azure IoT SDK C.

    I have cloned the repository using the LTS tag lts_01_2023 and the command git clone -b lts_01_2023 I could provision the device without any issues with the latest SDK following the steps. Please refer the below image to find the output of my testing.

    enter image description here

    provided global provision URL You have mentioned that you provided the provision URL. I am not sure what you meant by this. Can you add more clarification on this.

    Can you also make sure that the certificate and the private key you have set have the correct formatting without any spaces or formatting issues? The document suggested to use a Git bash command sed -e 's/^/"/;$ !s/$/""\\n"/;$ s/$/"/' ./certs/device-01-full-chain.cert.pem and sed -e 's/^/"/;$ !s/$/""\\n"/;$ s/$/"/' ./private/device-01.key.pem to extract the certificate and private key in the correct format.

    I appreciate it if you can review the above feedback and let me know your observations.