Migrate the identity local sql to an existing database on azure - azure

I am sort of new to MVC, as it has been a few years since I used it.
I created a new site with individual passwords option selected. The wizard created a local database for me, and uses code first to create the database and table for identity management.
I tried changing the connection string to be the same as my entityframework connection string, and that did nothing, even after I ran the app. In fact, it seemed to have no effect, and somehow it still had access to the local db version.
How do I point the existing code first tables to build a new set of tables on my existing azure database, and then use those tables going forward?

Related

Azure mobile apps not seeing any tables in easy table

I'm creating a mobile app backend with Azure App Service. I created a database connection to an existing sqlserver db. However, when I clicked on the Easy Tables blade there were no results of the current table. How can I use the existing tables with this mobile app? Thanks
OK i figured this one out .. make sure the app connection string is correct, then go ahead and add the table to the easy tables list (like a new table), it will pick up all the existing columns in the table automatically!
Be careful: It also messes with the table structure adding deleted and roversion etc columns in azure style. It doesnt seem to delete anything though

Unable to create Easy Tables in Azure

I have created a Mobile App and Database in Microsoft Azure. Now I am trying to create Easy Tables from Mobile App but I am getting error message "You need database to use East Tables. Click here to create one.
Even though I have existing database Easy Tables doesn't list it.
Below is the screenshot.
I have mapped Data Connection with mobile app, below is the screenshot
It would be great if anyone can help, I am new to azure.
Your connection string must be created with name: MS_TableConnectionString
Just because you have a database doesn't mean it is linked. Click on Data Connections, then Add, then add your existing SQL database.
Note that Easy Tables won't recognize the existing tables unless you add them through Easy Tables. There are notes around the format of Id (it needs to be
a string) and other fields.
When you created your Database Server did you check "Allow azure services to access server"? That could be why you cannot see the Database listed.

Accidently Deleted Contents of Azure Mobile Service table

I was deleting a single record in the Classic Azure Portal in Mobile Services Browse. The entire contents of the table has now disappeared. Please help!!! How do I restore the contents. The table and scripts are still there.
I have gone into the SQL database tab and clicked restore from point in time, this creates a new DB but does not give me an option to restore to Azure mobile services.
Restoring a database always creates a new database on the same server as the original database, so the restored database must be given a new name. Once complete, the restored database is a normal fully accessible online database charged at normal rates based on its service tier and performance level. If you are restoring the database for recovery purposes you can treat the restored database as a replacement for the original database, or use it to retrieve data from and then update the original database. Please check this article for details.
So if you are going to use the new database, you can re-configure your mobile service to use the new database as following snapshot shows(click the mobile service, go to configure tab then click change database):

Strange "invisible database bug" on SQL Azure?

I have a project (say project1) which runs with the following SQL Azure connection string:
Server=tcp:....database.windows.net,1433;Database=project1;User ID=...
The database project1 exists and everything on project1 runs fine.
Then I was working on a second project (project2), and uploaded it as a second Cloud Service in Azure. I intended to store its data in the database project1 under a different schema (since there is a plan to merge the two projects), but accidentally I deployed the project with the following connection string:
Server=tcp:....database.windows.net,1433;Database=project2;User ID=...
Everything on project2 was working fine, but then I noticed that project2's tables in the database project1 were empty, although I have entered data in the cloud service. Then I noticed that the connection string pointed to a database project2.
To make it clear, there is no SQL database with the name project2. I checked in SQL Management Studio, as well as in the Silverlight SQL Azure database client.
I cannot explain this. Somehow Windows Azure or SQL Azure must have implicitly created a database project2, since I was able to work on the Cloud Service. There must be some 'hidden place', where project2 had stored its data.
Is this a bug, or am I missing something?
If you try to connect to a database that does not exist, you will automatically be connected to the master database, at least that was the case last time I tried. However master is read-only in the cloud, so I would expect most apps to fail when connecting to master. SQL Database will not create a database automatically for you, so that can't be it either. Could it be that you are trapping/silencing errors in your code and as a result you could not tell you were really connected to master?

How to migrate db from SQL server to SQL Azure which contains asp.net membership provider with data

In one of my project i have used Asp.net membership provider and there is some data on production environment.Now i need to to migrate that DB with SQL Azure.
I have used SQLAzureMW tool to migrate that and that tool has done proper migration except aspnet_user table's data and some of SPs and i have skip that table manually at time of final step on that tool
When i have looked in to data then aspnet_users table's data missing!
I have also read about New script for SQL Azure but i think that is for to create from scratch, i also heard about Universal Provider but confused in that.
As per my requirement what steps i need to follow to migrate existing sql db to windows azure sql db(WASD) with data and considering this what would be impact of that on application?
Note: Session State is also being managed using SQL provider here
Update
Again i have tried it with SQLAzureMW tool and this time i noticed that due to default collation type some of Sps were missing so i have run that manually as per this link
However still i need to make sure would there be any issue regarding session state Or other thing as i have migrate it's from existing db to WASD?
the SQLAzureMW tool show any message that you skip?
I have had many problems with this tool, but finally I could did everything with it. I would try creating first time Data Schema Only, and after copying the Data. Maybe you should use also DROP and CREATE option when generating the script, if the old data can't be overwrite. I hope this helps!

Resources