John Jerrby
John Jerrby

Reputation: 1703

Create connection to DB from azure

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...)

Upvotes: 1

Views: 158

Answers (1)

Rick Rainey
Rick Rainey

Reputation: 11256

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.

Upvotes: 3

Related Questions