Setting up an SQL server proxy is offered as part of our onboarding services.
Before you can set up an SQL server as an external data source, you will first need to publish a proxy service to handle the secure communication to your data base.
Once you set that up, you will use MSAL authentication to secure your proxy service and only allow authenticated users to access that proxy, using SSO (Single Sign On), from your SharePoint environment.
Code setup:
Clone this GIT repo: https://github.com/SnapOn-Software/sqlproxy
For more detailed information, follow the readme instructions in the GitHub repo.
Securing your data source
Publishing an azure function as a proxy to access your data base might expose your data to the internet.
It is highly recommended securing your proxy using MSAL authentication + SSO to make the user experience transparent, while blocking unauthorized access.
To secure your endpoint with MSAL authentication read Securing azure functions with MSAL.