Hi @yash shah Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
I am checking to see if you are using the sample provided in the GitHub sample The sample uses Azure IoT Central Provisioning Service ID Scope, your device registration ID and device ID for authenticating with the Azure IoT Central application. The article Quickstart: Connect an ESPRESSIF ESP32-Azure IoT Kit to IoT Central provides the detailed steps needed to set up the device on IoT Central and configure the sample code to connect the device.
I highly appreciate it if you can review the approach suggested in the article and let us know if you still encounter any issues with connecting to the IoT central application.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.