How to connect to a Sql Server VM via private IP with Azure Website

1

I have an Azure VM with port 1433 endpoint created. The internal IP is 110.119.38.72.

In my Azure Standard Website Web.Config connstring if have:

Server=110.119.38.72;Database=MyDB;uid=username;pwd=password;

I am getting the error:

[Win32Exception (0x80004005): Access is denied]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server.

See screenshot for more details: enter image description here

If I change my connection string to the Public IP of my Azure Sql Server I am able to connection.

How can I used the Internal IP of my Sql Server VM in my Azure Website?

asp.net-mvc
azure
azure-sql-database
asked on Stack Overflow Jan 20, 2015 by Brian Ogden

1 Answer

1

By default you can't. However, Azure websites now support running on a Virtual Network, so (in theory) you should be able to create a vnet and place both your SQL Server vm and the Azure Website on that vnet. That should enable you to connect to the db using the internal (vnet) ip address of the vm. I haven't tried this tho, so no guarantees.

answered on Stack Overflow Jan 20, 2015 by Trondh

User contributions licensed under CC BY-SA 3.0