Convert an add-in-scoped external content type to tenant-scoped
Learn how to create an OData-based external content type using Visual Studio 2012 auto-generation tools and import it into the Business Connectivity Services (BCS) metadata store so that it can be used across an entire tenant workspace. BDC models are complex XML definitions of an external data source. They are used when defining external content types for BCS. They are very difficult to build manually, so tools have been built to automatically generate the files using Visual Studio 2012 and Office Developer Tools for Visual Studio 2012. Using these tools, you can create an .app package using Visual Studio publishing, and then open that package to extract the model file.
Extract the BDC model file from a Visual Studio add-in package
The following steps show you how to create the OData-based external content type and then import it into the BCS metadata store so that it can be used across an entire tenant workspace.
To create a BDC model file from an OData source
In Visual Studio 2012, create an Add-in for SharePoint project.
Specify the add-in settings, including add-in name, the site URL for debugging the add-in, and how you want to host the add-in ( Autohosted, Provider-hosted, or SharePoint-hosted). For more information, see Choose patterns for developing and hosting your SharePoint Add-in.
Choose Finish to create the app.
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:
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 add-in-scoped external content type as an add-in package
In Visual Studio, on the Build menu, choose Publish.
Name the package, specify the save location on your local hard drive, and choose Finish.
To extract the model file from the .app package
Open the folder where the .app package is created.
Change the file name extension from.app to.zip.
Extract the ZIP package to a local folder.
Open the extracted folder to find the WSP file.
Move the WSP file to another location.
Change the .wsp file name extension on this file to .cab.
Open the .cab file, and you will find the Bdcmodel.bdcm file.
Save the Bdcmodel.bdcm file to another location.
To import the model file using SharePoint Central Administration pages
Open SharePoint Online or SharePoint on-premises Central Administration pages.
Choose Manage serve applications.
Choose Business Data Connectivity Service.
Choose the Import link on the server ribbon.
Choose the Browse button to specify the location where you extracted the .bdcm file.
Keep the default settings, and then choose Import.