1

I have created new data service with SQL data Base in azure. now I create new VS2013 azure project MVC and now I want to connect the DB to the APP ,how should I do that ? I try on the model-> add ->ADO.net entity data ->give name ->from existing DB .and now I want to find the DB which I have created in azure how should I see that (when I create new sql db loacally I can see that DB...)

1 Answer 1

3

The first thing you will need to do is add your client machine's IP address to the allowed IP addresses for your SQL Database Server in Windows Azure. You can do that easily from the portal in the CONFIGURE section for your server (not database). Here, it will detect your client IP and you can just click the link to add it to the allowed IP address list.

Allow client IP to SQL Database Server in Windows Azure

Next, when you're drilling down the ADO.NET Entity Data Model screens, click on the New Connection button to add a connection to your SQL Database Server.

Click on the New Connection button

In the New Connection window, fill out the information for your server, which will be

  1. .database.windows.net
  2. Change the authentication to SQL Authentication and enter your credentials.
  3. Select your database from the list.

Enter new connection details to connect to the SQL Database Server

That should do it. Click the OK button and you're on your way.

Sign up to request clarification or add additional context in comments.

3 Comments

@HI Rick thank you very much ,Voted up. I put the IP which I retrieve from azure and click on refresh put the user cardinals for the SQL DB which I created in azure and I dont see nothing in the Data base name ,when I click on the drop down list I got 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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) . any idea what I miss here ?
in addtion just to verify ,the IP which should I put in the server name is of the Windows IP ?or the IP which I get when I open the screen that you capture in the answer..(there is IP that I get as defult in current client IP address
It's not the IP you want to put in the server name, it's the actual name of the server your SQL Database is on. It will be something cryptic like wdojkw12.database.windows.net. The IP I was referring to in the first step is your computer's IP. If you go to the Windows Azure Portal click on SQL DATABASES on the left navigation. Highlight your database and click on the SERVER link (5th column to the right). Then, click on the CONFIGURE tab at the top and you will see screen like I referenced in the first step. There's a link there to add your client IP to the allowed list of IPs the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.