I wrote a custom function and when I use Jdbc.getConnection(), it works fine. But when I use Google "recommended" Jdbc.getCloudSqlConnection() instead -- because I want to remove the horrendously long (!) list of IP ranges that using the former method requires that I whitelist on my Cloud SQL MySQL instance -- it always fails with a "#ERROR! Exception: You do not have permission to call Jdbc.getCloudSqlConnection. Required permissions:
https://www.googleapis.com/auth/sqlservice"
I checked in the App Script Editor Overview that I do have the following "Requested":
When I go to the URL "
https://www.googleapis.com/auth/sqlservice" in my browser, it returns an unhelpful message stating that "your input OAuth2 scope name is invalid or it refers to a newer scope that is outside the domain of this legacy API". Uhm, which is the "legacy API", the Jdbc.getCloudSqlConnection() (that Google's docs recommends) ....?
Searched on S/O and on this forum, but nothing suggested works ... Anybody has any further ideas?
Thanks!
-Wing