0

I'm evaluating Xamarin and Azure. I would like to use App Service as a backend store.

I downloaded the C# backend and the Xamarin.Forms client application

I published the backend but it doesn't create the TodoItem table in my SQL Azure database.

It's possible to create this table by selecting the Node.js backend and click the Create TodoItem table. After this, the client application works nicely.

So, is there something to do for the C# backend to create the tables at startup?

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Julien Ferraro
  • 379
  • 4
  • 20

1 Answers1

2

is there something to do for the C# backend to create the tables at startup?

1.Add the data connection for Azure mobile service

enter image description here

2.Download the C# backend, and publish it to Azure. Make sure that conection string is the same as azure mobile App.

enter image description here

3.After that we could visit the browser (http://yourmobilesitename.azurewebsites.net/tables/todoitem?ZUMO-API-VERSION=2.0.0) it will create todoitem table for us automatically.

enter image description here

4.Check it from the VS Server Explorer

enter image description here

Note: If we want to connect the Azure SQL, we need to add the client ip in the Azure SQL firewall to allow our client to connect.

enter image description here

Another way is that we could use code-first migration easily to do that. I created a demo before, more detail please refer to another SO thread. We also could get more info from this tutorials.

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47
  • Perfect ! I activated migrations, and now everything runs fine. TY – Julien Ferraro Jun 21 '17 at 06:51
  • I didn't have to activate the Migration, the only thing i had to do is to go to `tables/todoitem?ZUMO-API-VERSION=2.0.0` which created my tables automatically, thank you so much for your post as i was stuck for hours figuring out why it is not creating tables in my SQL_DB – Ali Jan 17 '18 at 05:50