0

I have added some tables to my database in in windows azure via entity framework however I am not able to access these tables through the server side scripts (mobile services custom api)and they do not appear through the "MOBILE SERVICES: DATA" section. Do I have to add these tables and set permissions on them manually though the portal to get access to these via the scripts etc? I am sure there is some documentation on this somewhere but have been chasing my tail trying to find it.

The only table that currently appears there is the TodoItem table created by default.

A bit of direct on this would be great

user1619480
  • 533
  • 8
  • 18

2 Answers2

0

you need to move it to the schema of your Mobile Services App and add the tables, see: http://blogs.msdn.com/b/jpsanders/archive/2013/05/24/using-an-existing-azure-sql-table-with-windows-azure-mobile-services.aspx

JuneT
  • 7,840
  • 2
  • 15
  • 14
  • Thanks JuneT, does that mean I cannot access tables from a different schema within a mobile service? My userprofile table is in the default dbo schema and and I feel that is where it should stay. If it stays there, I get the identity (username) through the mobile webservice, I will not be able to get the user ID and will have trouble accessing or modifying any other data from tables that use the UserID. Perhaps I am taking the wrong approach? – user1619480 Aug 17 '13 at 15:18
0

You only need to define the table name through the portal interface, its pretty easy to use. This is also when you define if that table requires authentication, and which kind of authentication you will use, also pretty well explained in the interface so I will leave that to you. After you've done this basic layout in azure, the entity framework will take over and define the table details from within your code. (Version and table type Depending) Something like;

private IMobileServiceSyncTable<MyTable> mySyncTable = App.MobileService.GetSyncTable<MyTable>();

Your table names in azure must exactly match the class names that your using in the code to define the tables, this mirroring is how the server maps your data to its intended location in the cloud.

You should now have complete access to your cloud data from the MobileServices API by calling operations on mySyncTable.