Hello @Robert Chow - Thanks for reaching out and posting on the MS Q&A.
Here's an official documentation using Powershell functions & Hybrid Connections: Managing hybrid environments with PowerShell in Azure Functions and App Service Hybrid Connections
Azure Functions is great for stateless executions but for stateful workflows such as establishing a connection to an on-prem SQL server, you might look at Azure Durable Functions, Logic Apps, and WebApps. For example, you can create a workflow in Logic Apps that interact with the on-prem SQL Server, and call your Function App in the same workflow too: Create and run code from workflows in Azure Logic Apps using Azure Functions
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.