0
votes

I have found a articles on how to connect to Cloud SQL using .Net Core but nothing for .Net Framework.

I found this one but adding tcp: before the instance did not work How do I connect to Google Cloud SQL Server using C#?

I setup a Compute Engine using Windows 2016 Server with IIS installed. The web pages come up fine but they do not connect to the Cloud SQL. I am able to connect to the server through Management Studio using the sql proxy service so I know instance and database are correct.

Here is the connection string that I am using:

<add name="connectionString" connectionString="Data Source=<instance>;Initial Catalog=<database>" providerName="System.Data.SqlClient"/>
1
What specifically is the error when you're connecting the Cloud SQL? How are you trying to connect to the Cloud SQL? - RJC

1 Answers

0
votes

With the Cloud SQL Auth Proxy running on the Compute Engine VM instance, trying using

Data Source=tcp:127.0.0.1,1433;

in the connection string for your web app.