Hi @sangeetha san ,
Assuming that you have a working code that would write data into on premise terra data server, you will have to configure a hybrid connection in Azure Function app. Please make sure that the function app is either created in Dedicated App service plan or Premium SKU which supports networking options. The following articles would help in configuring hybrid connectivity with the on prem server.
https://devblogs.microsoft.com/premier-developer/using-azure-app-services-with-hybrid-connections/#how-it-works
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
Once the configuration is complete, please try to reach the on prem server from function app console, by doing a tcpping test. If you are able to reach the on prem server, then you can deploy the code to the Function app.
Hope this helps! Feel free to reach out to me if you have any questions or concerns.