Azure Mobile Services .NET Backend

Preview:

DESCRIPTION

Technical session on at Kerela Microsoft Users Group (K-MUG), on 26th July, 2014

Citation preview

Azure Mobile Services .NET Backend

Shiju Varghesehttps://github.com/shijuvar

About Me

• Microsoft Azure MVP• Microsoft Azure Insider• Member of Advisory Board, Azure Mobile

Services• Cloud Solutions Architect• Twitter - @shijucv • http://weblogs.asp.net/shijuvarghese

Agenda

• Azure Mobile Services• Azure Mobile Services .NET Backend• Demos

Azure Mobile Services

Azure Mobile Services provides a turnkey way for mobile developers to add a cloud-hosted backend to their app. Backend logic can be written in either Node.js or ASP.NET Web API.

Azure Mobile Services .NET Backend

Azure Mobile Services .NET Backend, lets the .NET developers add a backend to their mobile apps, using ASP.NET Web API and the Visual Studio tooling experience.

Azure Mobile Services

Data

Notifications

Auth

Server Logic

Scheduler

Logging & Diag

Scale

Azure Mobile Services• Scalable, Mobile backend as a services on the

Cloud• Native SDKs for Windows Phone and Windows

Store, Android, iOS, Xamarin, HTML5, Sencha, and PhoneGap.  

• Push notifications to millions of mobile devices• User authentication with Active Directory,

Facebook, Twitter and Google• Store data in SQL, Table Storage and MongoDB

Azure Mobile Services

• Access on-premises systems, Office 365 and SharePoint

• Use cloud-based sync to build apps that work offline

• Scheduler services for schedule recurring jobs• Auto-scaling, service monitoring and

management

Automatic REST API for the Virtual Tables

Action HTTP Verb URL Suffix

Create POST /TodoItem

Get All GET /TodoItem

Get GET /TodoItem/id

Update PATCH /TodoItem/id

Delete DELETE /TodoItem/id

Data Operations and their REST Equivalents

REST API Endpoint

http://{service}.azure-mobile.net/tables/{table-name}/

Create Mobile Services Client in Windows Store App

using Microsoft.WindowsAzure.MobileServices;

MobileServiceClient MobileService = new MobileServiceClient("https://{mobile_service_name}.azure-mobile.net/", “{application_key}“);

Working with MongoDB As A Data Store Step 1 - Install the WindowsAzure.MobileServices.Backend.Mongo NuGet package.Step 2 – Create data models derived from DocumentData instead of EntityData.public class Order : DocumentData{ public DateTime OrderDate { get; set; } public string Client { get; set; } }

Using MongoDB As A Data Store

Step 3 - Initialize method with the following:protected override async void Initialize(HttpControllerContext controllerContext){ base.Initialize(controllerContext); string connectionStringName = "MongoConnectionString"; string databaseName = "<YOUR-DATABASE-NAME>"; string collectionName = "todoItems"; InitializeConnectionString(connectionStringName); DomainManager = new MongoDomainManager<TodoItem>(connectionStringName, databaseName, collectionName, Request, Services);}

Nothing but demos

Get a Windows Azure Free Trial Account

http://azure.microsoft.com/

Windows Azure Mobile Services

http://azure.microsoft.com/mobile

Resources

Be well,write good code,

and stay in touch@shijucv

https://github.com/shijuvar

Recommended