Hello @Nitesh,
great to see you are starting with Azure IoT.
It seems you are combining two completely different pieces of code which will never fit together.
The IoT Hub triggered Azure Function is designed to listen to incoming device messages coming from the IoT Hub.
A device is normally an application running on an actual device like this one written in C# or this one written in Python.
Please, take some time and learn about Azure IoT Device SDKs using the learning module, part of a complete Azure IoT learing path.
Next to that, the Azure Functions training is also a perfect way to start learning about that topic.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.