Add functions to trusted sources
Tomáš Livora
If a managed database has connections restricted to trusted sources, it is not possible to connect to it from serverless functions deployed to namespaces (outside the App Platform).
Consider adding an ability to specify a function, package, or namespace in the list of trusted sources of a database.
Anonymous
It is now January 2024. I stumbled upon the same issue. I spent some time implementing my transcoding function. Just to figure out that app platform functions cannot run asynchronously. I was advised to move it to function namespace. But there, I cannot use database. This renders functions quite useless despite they have a great potential.
Bernardo Castro
This is what DO Functions are missing for use in production.
Darryn Ten
Bernardo Castro: all you need to do is add a new app to the App Platform that only consists of your function and then you can add the new app as a trusted source and your function will be able to access your db
Bernardo Castro
Darryn Ten: That way, it's a real mess. Also, it must be GitHub or GitLab and I don't use either. The ideal is organizing all in DO Functions - not?
J
Jochem Berends
Good point. For us we cannot use functions as of current because of this.
Daniel Doubrovkine
Coming from https://www.digitalocean.com/community/questions/is-it-possible-to-have-a-non-web-app-function-with-a-cron-trigger I had the same problem, where I tried to implement a function that runs daily, and accesses my managed database. I don't want an app that's accessible externally, nor do I want to open up the database for internet access.
Bernardo Castro
Daniel Doubrovkine: It is the point. Without access to the DB with trusted sources, so is possible only create basic scripts. Example calc 1+1
Daniel Doubrovkine
Bernardo Castro: I am not sure what you're saying. I don't want a basic script function, I want a non-public function that has access to my managed database.