I am trying to connect to Google Cloud SQL from my local windows machine using SQL Proxy.
I am able to connect using authenticated Cloud SDK client:
C:\>cloud_sql_proxy -instances=my-proj:us-central1:my-instance=tcp:5000
2020/09/10 01:31:50 Listening on 127.0.0.1:5000 for my-proj:us-central1:my-instance
2020/09/10 01:31:50 Ready for new connections
However, when I try to connect using a service account and credential file, it fails:
C:\>cloud_sql_proxy -instances=my-proj:us-central1:my-instance=tcp:5000 -credential_file=C:\credentials.json
2020/09/10 11:12:01 using credential file for authentication; email=svc-acct@my-proj.iam.gserviceaccount.com
2020/09/10 11:12:03 errors parsing config:
Get https://www.googleapis.com/sql/v1beta4/projects/my-proj/instances/my-instance?alt=json&prettyPrint=false: oauth2: cannot fetch token: unexpected EOF
Not sure what I am missing here. Please help.