Windows 2012 R2 Azure VM Cannot Connect To Local SQL Server

1

I created an Azure virtual machine running Windows Server 2012 R2 that I am using as a web server to host a couple different web sites. This is my first time ever doing something like this and I am struggling to get it to work. I installed IIS 8.5 and I am able to access my websites externally so I got that working but I cannot access any of the data that my sites get from a local SQL database. I get a crazy error that starts out like this and has a lot of other stuff I could not really make sense of.

 System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

I have a previously configured virtual network that is set up according to our network guy with all the proper gateway IP addresses and client address spaces to connect be able to connect to the database. I have the endpoints 1433 and 1434 added which I was told from a tutorial I needed for SQL to communicate.

The weird thing is I can connect to the SQL server through SQL Server Management Studio on my Azure VM. It is jut not working connecting through the connection strings in my applications.

Here is the connection string that is in my application. Like I said before when I go to DbName1.domain.com and type in that password on my Azure VM in SSMS I can access all the data just not through when I browse to the application.

Server=DbName1.domain.com;Database=Materials;User ID=web;Password=●●●●●●●●

Any input is appreciated, Thanks.

EDIT 1: Yeah they are enabled. But I am not accessing the SQL Server with SSMS locally I am able to do it with SSMS on my Azure VM. Any idea why I can connect with SSMS but im getting an error in my application saying that the server is not found or accessible?

windows-server-2012-r2
azure
iis-8.5
asked on Server Fault Feb 16, 2016 by Ty53ler • edited Feb 17, 2016 by (unknown user)

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0