I have a simple Cloud Run application written in Java that accesses a Cloud SQL MySQL database. I am using the Spring Google Cloud Platform utilities (spring-cloud-gcp-starter-sql-mysql) to interact with the database. When I deploy the app to Cloud Run, it runs great, having no problems when it queries the MySQL database.
I am using Visual Studio (VS) Code as my integrated development environment (IDE). VS Code includes a utility called Cloud Run Emulator that allows you to run your Cloud Run application locally in VS Code. When I run the application, I get this error: "The Google Cloud SQL Admin API is not enabled for the project "card-builder". Please use the Google Developers Console to enable it: <URL to the Cloud SQL Admin API>” Seems simple enough, only the API is already enabled, and has been for days now.
Further down the list of errors I see, “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.” I tried to provide a credential for the Compute Engine default service account. I generated a key for the account in JSON format and then set the “spring.cloud.gcp.credentials.location” parameter. When I do that, the service does not even deploy, failing with the error, “Deploy Failed. Could not connect to cluster due to "https://127.0.0.1:51949/version?timeout=32s": net/http: TLS handshake timeout. Check if minikube is running using "minikube status -p cloud-run-dev-internal" command and try again.”
At any rate, I am not sure where to go next. Any insights are appreciated. Thanks.