Entity Framework creating settings table that I can't put on Azure

I've been trying to create an ASP.net - MVC app that uses entity framework to connect to an Azure database.

I used a database first method to try and create the Model, I was able to connect to my azure database and successfully create the model.

Everything was working perfectly and I was able to retrieve my values from my azure database then I tried to publish the website to an Azure website. The website works fine and I have the website registered as able to use the azure database. When I click on the button that hits the controller to access the database I then get "Sorry, an error occurred while processing your request."

When I looked into this a bit more I seen that when I created my Entity Data model using the wizard it created a connection string to a local db for my entity connection settings. I'm guessing this is saving some entity framework settings but my problem is obviously when I publish the website to Azure it can't access this local db.

Any suggestions on how to either get this DB onto Azure or avoid using this extra database?

Thanks

Answers


This is the best tool to migrate your local database to Azure. Before publishing your site change the web.config to point to the Azure database. It will solve your problem.


Like you already explained, it seems that you web.config still points to your local database. Try to look at your web.config and see if you have connection strings pointing to .\SQLExpress, localhost\SQLExpress, ".", ...

Then, like Geenthanga's explains, you need to modify this value before deploying (it should point to your SQL Azure database instead). But you shouldn't do this manually! Instead, consider using web.config transformations, as explained here: Web Deployment: Web.Config Transformation.

This way you can have 2 web.config transformation files:

  • Web.Debug.config: This file would contain the transformations to add the connection string pointing to your local database.
  • Web.Release.config: This file would contain the transformations to add the connection string pointing to SQL Azure.

Need Your Help

Make exits with “Error 2” when trying to install gcc-4.8.1

gcc amazon-ec2 make ec2-ami gcc4.8

I'm trying to install gcc-4.8.1 on an AWS ec2 "Other Linux" distribution. I downloaded gcc-4.6.2.tar.gz and then followed these instructions under the 'Configuration' heading from

How do you find the subject of a sentence?

java php nlp

I am new to NLP and was doing research about what language toolkit I should be using to do the following. I would like to do one of the two things which accomplishes the same thing:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.