Create a Windows app

Overview

This tutorial shows you how to add a cloud-based backend service to a Universal Windows Platform (UWP) app. For more information, see What are Mobile Apps. The following are screen captures from the completed app:

Completed desktop app
Running on a desktop.

Completed phone app
Running on a phone

Completing this tutorial is a prerequisite for all other Mobile App tutorials for UWP apps.

Prerequisites

To complete this tutorial, you need the following:

  • An active Azure account. If you don't have an account, you can sign up for an Azure trial and get up to 10 free mobile apps that you can keep using even after your trial ends. For details, see Azure Free Trial.
  • Visual Studio Community 2015 or a later version.

Create a new Azure Mobile App backend

Follow these steps to create a new Mobile App backend.

  1. Sign in to the Azure portal.

  2. Click New.

  3. In the search box, type Mobile Apps.

    Azure portal with Mobile Apps Quickstart highlighted

  4. In the results list, select Mobile Apps Quickstart, and then select Create.

  5. Under Resource Group, select an existing resource group or create a new one (using the same name as your app).

  6. Click Create. Wait a few minutes for the service to be deployed successfully before proceeding.

You have now provisioned an Azure Mobile App backend that can be used by your mobile client applications. Next, you will download a server project for a simple "todo list" backend and publish it to Azure.

Configure the server project

  1. Click the App Services button, select your Mobile Apps back end, select Quickstart, and then select your client platform (iOS, Android, Xamarin, Cordova).

    Azure portal with Mobile Apps Quickstart highlighted

  2. If a database connection is not configured, create one by doing the following:

    Azure portal with Mobile Apps Connect to database

    a. Create a new SQL database and server.

    Azure portal with Mobile Apps create new database and server

    b. Wait until the data connection is successfully created.

    Azure portal notification of successful creation of data connection

    c. Data connection must be successful.

    Azure portal notification, "You already have a data connection"

  3. Under 2. Create a table API, select Node.js for Backend language.

  4. Accept the acknowledgment, and then select Create TodoItem table.
    This action creates a new to-do item table in your database.

    Important

    Switching an existing back end to Node.js overwrites all contents. To create a .NET back end instead, see Work with the .NET back-end server SDK for Mobile Apps.

Download and run the client project

Once you have configured your Mobile App backend, you can either create a new client app or modify an existing app to connect to Azure. In this section, you download a UWP app template project that is customized to connect to your Mobile App backend.

  1. Back in the Quick start blade for your Mobile App backend, click Create a new app > Download, then extract the compressed project files to your local computer.

    Download Windows quickstart project

  2. (Optional) Add the UWP app project to the same solution as the server project. This makes it easier to debug and test both the app and the backend in the same Visual Studio solution, if you choose to do so. To add a UWP app project to the solution, you must be using Visual Studio 2015 or a later version.
  3. With the UWP app as the startup project, press the F5 key to deploy and run the app.
  4. In the app, type meaningful text, such as Complete the tutorial, in the Insert a TodoItem text box, and then click Save.

    Windows quickstart complete desktop

    This sends a POST request to the new mobile app backend that's hosted in Azure.

  5. (Optional) Stop the app and restart it on a different device or mobile emulator.

    Windows quickstart complete phone

    Notice that data saved from the previous step is loaded from Azure after the UWP app starts.

Next steps

  • Add authentication to your app
    Learn how to authenticate users of your app with an identity provider.
  • Add push notifications to your app
    Learn how to add push notifications support to your app and configure your Mobile App backend to use Azure Notification Hubs to send push notifications.
  • Enable offline sync for your app
    Learn how to add offline support your app using an Mobile App backend. Offline sync allows end-users to interact with a mobile app—viewing, adding, or modifying data—even when there is no network connection.