MSDN Library
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

Create a table

 

Updated: June 16, 2015

Before you can use Microsoft Azure Mobile Services to store app data, you must create at least one storage table in the Microsoft Azure SQL Database associated with the mobile service instance. When you complete the quick start, you have a table named Todoitem in your database.

System_CAPS_noteNote

Each table must have a unique name within the scope of the mobile service. The table in the SQL Database is created with a schema name that matches your mobile service name.

To add a new table to a JavaScript backend from the Management Portal, click Create, supply the Table Name, and the select the insert, update, delete, and query permissions for the table from the following:

  • Everyone: This means that any request for the operation against the table is accepted. This option leaves your data wide-open for everyone to access.

  • Anybody with the Application Key: The application key is required to perform the operation. The application key is distributed with the application. Because this key is not securely distributed, it cannot be considered a security token. To secure access to your mobile service data, you must instead authenticate users before accessing.

  • Only Authenticated Users: Only authenticated users are permitted to perform the operation. Scripts can be used to further restrict access to tables based on an authenticated user. For more information, see Get started with users (Windows Store C# / Windows Store JavaScript / Windows Phone / iOS / Android / HTML).

  • Only Scripts and Admins: The operation requires the service master key, which limits the operation only to registered scripts or to administrator accounts.

When dynamic schema is enabled in a JavaScript backend, Mobile Services automatically generates new columns based on the JSON object in the insert or update request. For more information, see Dynamic schema.

To add a table to a .NET backend, you just add a new property to the Code First data model that returns a DbSet based on a new model data type that inherits from the EntityData type. For more information, see How to make data model changes to a .NET backend mobile service

The following columns are added in the database to every table created by Mobile Services:

  • id

  • __createdAt

  • __updatedAt

  • __version

The columns named with a "__" prefix are used by nextref_zumo for system property columns. For more information, see System columns.

Vis:
© 2016 Microsoft