How to: Create an app-scoped external content type in SharePoint 2013
Published: July 16, 2012
Learn how to create external content types that can be installed, secured, and used in an app for SharePoint.
Applies to: SharePoint Server 2013
To get started developing app-scoped external content types, you need the following:
Visual Studio 2012
Office Developer Tools for Visual Studio 2012
A published OData service available through the Internet
For information about setting up a SharePoint development environment, see Start: Set up the development environment for SharePoint 2013.
The following steps show how to create an external content type based on an Open Data protocol (OData) source, and how to modify it to be scoped to your app for SharePoint.
To create a new app for SharePoint
Open Visual Studio 2012.
Create an App for SharePoint 2013 project.
Specify the app settings, including app name, the site URL for debugging the app, and how you would like to host the app (Autohosted, Provider-hosted, or SharePoint-hosted). For more information, see Choose patterns for developing and hosting your app for SharePoint.
Choose Finish to create the app.
For complete steps for creating apps for SharePoint, see the following:
To generate the external content type
In Solution Explorer, open the shortcut menu for the project, and choose Add, Content types for External Data source.
This starts a wizard that helps you find the selected data source and create the BDC model.
On the Set OData Source page, enter the URL of the OData service that you want to connect to. The URL should look something like this: http://services.odata.org/Northwind/Northwind.svc/.
Specify a name for your OData source.
For this example, you will use the Northwind service that is available from the producers list located on the Open Data Protocol website.
A list appears showing data entities that are being exposed by the OData Service. Select one or more of the entities, and choose Finish.
To deploy the app-scoped external content type
Press F5 to compile the project and upload the project files to SharePoint.