I'm trying to connect to a database from VS2017
var str = str1.ConnectionString =
"Data Source=141.*****.199;" +
"Initial Catalog=****;" +
"User id=***;" +
"Password=****;";
using (SqlConnection conn = new SqlConnection(str))
{
try
{
conn.Open();
var text = "SELECT * FROM Users u WHERE u.Id=76769";
...
}
catch (Exception e)
{
return req.CreateResponse(HttpStatusCode.OK, e.ToString());
}
and get error
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
It's azure function. If I set this connection from LogicApp, then there are no errors. Why the connection does not work from the azure-function?