@Ceci Ivanov Thanks for reaching out.
To answer this "what configuration needs to be done so it can access the service bus via the private endpoint and not via the public endpoint with the shared access key (connection string)"
Your function app would have the app settings SERVICEBUS_CONNECTION that should now point to private DNS endpoint name for your service bus.
Key: SERVICEBUS_CONNECTION Value: <your-service-bus-namespace-name>.privatelink.servicebus.windows.net
Note: Please use the same key that you have defined for your service bus binding and not as per the above example.
To know more about service bus private endpoint please refer to this document and to learn azure function with private endpoint please refer to this document.
Let me know if I misunderstood your ask or you need any assistance.
Please click on 'Yes' if it helped so that it can help others in the community looking for help on similar topics.