2017-02-07 88 views
0

我已經成功創建了SQL Server 2008的Azure VM。我繼續並添加了Web服務器角色。我還通過遠程處理將我的工作Web應用程序複製到了VM上。在VS2008 Azure虛擬機中連接到SQL Server 2008

我可以從SQL Server Management Studio運行查詢。

我做了相應的改動我的網絡配置文件,但我得到的錯誤

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)

回答

0

你應該確保端口1433在虛擬網絡上是開放的(除非你改變了SQL Server的默認端口)並且您還應該確保已爲您的服務器啓用SQL身份驗證

這個問題How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?也有一些可能的解決方案。

在Azure的虛擬機上運行您自己的SQL Server與在本地服務器上運行它沒有多大區別。你仍然需要管理所有東西,例如端口開放,在你主機上運行的服務等等。

+0

現在我試圖從虛擬機本身作爲localHost運行網站。 – user3207906

0

4個移動部件:

  1. VM應該有公網IP,或者你應該有某種路由到虛擬機。
  2. 網絡安全組應允許在感興趣的端口上進行通信(1433)。
  3. VM上的防火牆應允許在感興趣的端口上進行通信。
  4. VM上的應用程序應該偵聽感興趣的端口上的流量。
相關問題