0
votes

I have successfully created Azure VM with SQL Server 2008. I went ahead and added Web server roles. I also copied my working web application on VM by remoting in.

I can run queries from SQL Server Management Studio.

I made corresponding changes to my web config file but I 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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

2

2 Answers

0
votes

You should make sure that port 1433 on the virtual network is open (unless you changed the default port for SQL Server) and you should also make sure you have SQL authentication enabled for your server.

This question How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'? also has some possible solutions.

Running your own SQL Server on a VM in Azure isn't much different from running it on a local server. You still need to manage everything like port openings, services running on you host and so on.

0
votes

4 moving parts:

  1. VM should have public IP, or you should have some kind of routing to the VM.
  2. Network Security Group should permit traffic on the port of interest (1433).
  3. Firewall on the VM should allow traffic on the port of interest.
  4. Application on the VM should listen to the traffic on the port of interest.