Visual Studio Home Visual Studio

Add connected services to your Apache Cordova app - DEPRECATED

Updated: 9/10/2015

NOTE: Azure Mobile Services is deprecated. Documentation on the new service, Azure Mobile Apps, can be found here.

The Visual Studio Services Manager for connected services lets you integrate Microsoft services like Azure Mobile Services, Office 365, and other services into your app built with Visual Studio Tools for Apache Cordova. The manager makes it easy to add services without leaving Visual Studio.

In this article:

For information and tutorials on using connected services like Azure and o365 with Cordova apps in Visual Studio, see the following articles and blog posts.

Azure

O365

To add a connected service, first open the Visual Studio Services Manager.

To open the manager

In Solution Explorer, open the shortcut menu for your project, and then choose Add, Connected Service.

Add a connected service

The following sections explain how to add different types of connected services.

Azure Mobile Services let you add cloud-based services such as data and push notifications to your app.

To add Azure Mobile Services to your app

  1. If you don't have an Azure account, create one.

  2. In Visual Studio, open the Services Manager, choose Windows Azure, and then choose Manage subscriptions.

    Sign in for Azure subscriptions

  3. Sign in to your account.

    Accounts available for your use will be listed here.

    List of Azure subscriptions

  4. In the Services Manager, choose Create service to add a new Azure Mobile Service, fill out the required information, and then choose OK.

    Create an Azure mobile service

    To get started, you will typically choose Create a free SQL Database, and then supply the Server user name, Server password, and Server password confirmation. The steps required here are similar to steps shown in the section "Create a new mobile service from Visual Studio" in this article.

    The new service appears in the Services Manager list of connected services.

  5. In the Services Manager, choose OK.

    Visual Studio adds a service.js file to your project under services/azure_service_name/. This file contains your Azure key for accessing and using the service in your app.

If you’re creating a TypeScript app, you’ll need a TypeScript definition (.d.ts) Files&referringTitle=Documentation) (.d.ts file) that describes the API surface of the Azure service you’re using. You can find definitions created by the community in NuGet, which you can access from Visual Studio.

To use Azure Mobile Services with TypeScript

  1. From the shortcut menu for the project in Solution Explorer, choose Manage NuGet Packages.

  2. Choose Online.

  3. Search for “azure-mobile-services-client”.

  4. Choose one of the “azure-mobile-services-client.TypeScript.DefinitelyTyped” definitions, and then choose Install to add the definition file to your project.

    Adding a TypeScript definition

    For more information about the definitions, open the Id link in the right pane.

You can develop apps by using the Office 365 APIs to access services such as email, calendar, and contacts. For more information, see Announcing Office 365 API Tools for Visual Studio on the Apps for Office and SharePoint blog.

To add Office 365 services to your app

  1. Install the Visual Studio extension for Office 365 API Tools.

  2. In Visual Studio, open Services Manager, and then choose Office 365 APIs.

    Tip If you don't see the Office 365 APIs in the Services Manager after installing them, close and reopen Visual Studio.

  3. If this is the first time you’re adding the service in Visual Studio, you might be asked to sign in to your Office 365 developer account. Choose Sign in.

    Installing Office 365 APIs

    After you sign in, you can configure permissions for different Office 365 services.

Download the tools Get the Visual Studio Tools for Apache Cordova or learn more

See Also

Get Started with Visual Studio Tools for Apache Cordova

Did you find this article helpful?

Thanks!

We're sorry to hear that! Feel free to email our team with your question.


Want FASTER answers? Our team monitors a special StackOverflow tag here.