none
Can you connect a local VS 2013 project to a SQL Azure database? RRS feed

  • Question

  • Hi,

    I created my first SQL Azure database and added a table.  Now I'd like to run a VS 2013 project locally to develop/test against it.  Is this possible? 

    I managed to use the connection string Azure suggested such as when I published my project to an Azure website...

    "Server=tcp:theserver.database.windows.net,1433;Database=mydb;User ID=user@theserver;Password=mypwd;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;"

    However, I'd like to run the project locally first before publishing each time.

    Thanks, Dave

    Wednesday, April 23, 2014 7:49 PM

Answers

All replies

  • there's no stopping your from connecting to it from you local machine or from somewhere. you just have to make sure you configure the Azure SQL Database firewall settings to allow the ip address from which your connecting from.

    likewise, for development purposes, you may also use SQL Server/Express/LocalDb rather than connecting to the Azure SQL directly for development.

    Wednesday, April 23, 2014 11:54 PM
    Answerer
  • Thanks.  I found this article http://azure.microsoft.com/en-us/documentation/articles/sql-database-manage-azure-ssms.

    All the Allowed IPs look OK but when I follow the steps 10-14 to to connect I get the following.  

    Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=105; handshake=14893;  (Microsoft SQL Server, Error: -2)

    I also configured my local firewall I set 1433 (Outbound and Inbound) and checked "SQL Sever Management Server" under the allowed apps to communicate through Windows Firewall but still no luck.


    • Edited by dat1 Thursday, April 24, 2014 1:30 PM
    Thursday, April 24, 2014 12:51 PM
  • Can you connect to it at all with your Visual Studio -> Server Explorer connection?

    Are you typing in the fully qualified name for the Azure Server?

    Aside from that, as long as you've opened up the IP addresses on the server settings from the azure portal, then you should be good


    R. Matt Sampson

    Thursday, April 24, 2014 7:30 PM
  • Well I tested this at home on my own network connection and I can now connect through SSMS and the Visual Studio's Server Explorer connection.

    I'm guessing there is a firewall rule blocking port 1433 at work? I was told by one of the DBAs today that it wouldn't be the case.  I'm guessing he could be wrong unless there is something else I need to consider but I made no changes to my laptop's settings since I came home.

    Thanks, Dave.

    Friday, April 25, 2014 2:02 AM
  • I finally go this resolved.  I had to work with my company's security team to open up 1433 for my IP.
    Thursday, May 8, 2014 6:07 PM