다음을 통해 공유


Backup Migrated Mobile Service (Node.Js backend)

You may have gotten this error when trying to backup a Migrated Mobile Service built with a Node.Js backend:

Database connection string not valid for database MS_TableConnectionString (SQLAzure). Keyword not supported: 'driver'.

Reason:

Backup is using ADO.NET internally. The Backup feature uses the Database Connection Strings to configure the Database backup and the setting: MS_TableConnectionString is for the node Driver and connection.

Fix:

Don’t use the MS_TableConnectionString.  Instead create a new ADO.NET connection string for your Database.  Configure the Database Backup settings so it picks up this new string, and save your changes.

Walkthrough of the fix:

Get the current connection string and create a new ADO.NET connection string

Go to your migrated Azure Mobile Service in the Dashboard and find the name of your Mobile Service DB in your Application Settings, MS_TableConnectionString.

It is under Application Settings, Connection Strings and hit the view connection strings link to see and copy this:

DataConnections1

Click on MS_TableConnectionString to copy it and save it in an editor like Notepad.  From this you can find your SQL Azure Database (see highlighted section).

Example: Driver={SQL Server Native Client 10.0};Server={tcp:aooc2mj075.database.windows.net,1433};Database=jsanderswestmobileservice_db;Uid=AvGdMxxLogin_jsandersmigratenodewest@aooc2mj075.database.windows.net;Pwd=Ns36hxx8663zZ$$;

 

Next in the portal

capture20160801095354648

 

Go to the SQL Databases tab, find the Database from the MS_TableConnectionString and click on it

capture20160729091857088

When it opens, click on the Database Connection Strings.

capture20160729092012721

Copy the ADO.NET connection string and save it

Example: Server=tcp:aooc2mj075.database.windows.net,1433;Initial Catalog=jsanderswestmobileservice_db;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

 

Replace the User ID and Password with the Db Admin or equivalent login

 

Now alter the ADO.NET connection string you just copied and add an appropriate UID and PWD that can do the backup (and restore)Important: The UID and PWD from you old connection string does NOT have sufficient privilages to do the backup.

Example: Server=tcp:aooc2mj075.database.windows.net,1433;Initial Catalog=jsanderswestmobileservice_db;Persist Security Info=False;User ID=dbadmin;Password=dbadminpwd;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

 

Create a new BackupConnection with the new value

Go back to your Migrated Mobile Service, under Settings, MOBILE, Data connections:App Settings, Connection Strings, View the connection strings and create a new Connection String called BackupConnection with the new connection string you created from the ADO.NET connection string.  Ensure the type is SQL Database.

capture20160729154522295

Tab out of the field and save your changes.

 

Reset the Database configuration in Backup

Go to the Backups setting and hit the Configure Icon

capture20160729094947895

Click on the Database Settings and toggle the check Icon on MS_TableConnectionString to turn it off and select the new BackupConnection, Hit OK and Save (this forces the configuration to update).

capture20160729154634075

Test your Backup by Manually kicking it off.

 

Summary

It is not complicated to enable backups this way but it is a ‘Gotcha’ so please let me know if this Post helped you out!