building windows 8.1 apps with mobile services

26
Building Windows 8.1 Apps with Mobile Services Ken Cenerelli Software Developer Desire2Learn @KenCenerelli kencenerelli.wordpress.com

Upload: ken-cenerelli

Post on 20-Aug-2015

347 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Building Windows 8.1 Apps with Mobile Services

Building Windows 8.1 Apps with Mobile ServicesKen CenerelliSoftware DeveloperDesire2Learn

@KenCenerellikencenerelli.wordpress.com

Page 2: Building Windows 8.1 Apps with Mobile Services

Agenda

Mobile Services

Push Notifications

Data Storage

Auth*

Other Features and Scaling

Questions

Page 3: Building Windows 8.1 Apps with Mobile Services

What is Mobile Services?

Data

Notifications

Auth

Server Scripts + Custom API

Scheduler

Logging & Diag

Scale

Page 4: Building Windows 8.1 Apps with Mobile Services

demo

Getting Started

Page 5: Building Windows 8.1 Apps with Mobile Services

Structured StoragePowered by SQL DatabaseSame DB – Multiple Mobile Services

AppX.TodoitemAppY.Todoitem

Data management inWindows Azure PortalSQL Portal, SQL Management StudioREST APICLI Tools

Page 6: Building Windows 8.1 Apps with Mobile Services

The REST API

Action HTTP Verb URL Suffix

Create POST /TodoItem

Read GET /TodoItem?$filter=id%3D42

Update PATCH /TodoItem/id

Delete DELETE /TodoItem/id

Data Operations and their REST Equivalents

Base REST API Endpoint URL

https://Mobileservice.azure-mobile.net/tables/*

Page 7: Building Windows 8.1 Apps with Mobile Services

JSON to SQL Type MappingsJSON Value T-SQL Type

Numeric values (integer, decimal, floating point)

Float(53)

Boolean Bit

DateTime DateTimeOffset(3)

String Nvarchar(max)

Page 8: Building Windows 8.1 Apps with Mobile Services

Server Side ScriptsCustomizing logic on the server

Node.js scripts

Passes through to SQL by default

Intercept CRUD requests to tables

Fully customizable logic flow

Page 9: Building Windows 8.1 Apps with Mobile Services

Node ModulesExtensibility through numerous included modules

request

console

push.*

mssql

statusCodes azure

sendgrid

pusher

twilio

Page 10: Building Windows 8.1 Apps with Mobile Services

demo

Adding Server Scripts

Page 11: Building Windows 8.1 Apps with Mobile Services

Push Notification Lifecycle Overview 1. Request Channel URI

2. Register with your Cloud Service

3. Authenticate & Push Notification

Windows 8

(1)

(2)

(3)

(3)

Page 12: Building Windows 8.1 Apps with Mobile Services

Push NotificationsIntegrates with WNS to provide Toast, Tile, Badge and Raw notificationsPortal captures your WNS client secret and package SIDpush.wns.* provides:

clean easy object model to compose notifications

Performs auth against WNS for you

Page 13: Building Windows 8.1 Apps with Mobile Services

demo

Push Notifications

Made easy with the VS 2013 Wizard

Page 14: Building Windows 8.1 Apps with Mobile Services

Auth*Authenticate against Microsoft Account, Twitter, Facebook, GoogleTable level permissions for each CRUD operation

EveryoneAnyone with the Application KeyOnly Authenticated UsersOnly Scripts and Admins

More granular control with server side scriptsuser.level: {admin, authenticated, anonymous}

user.userId: id or undefined if not authenticated

Page 15: Building Windows 8.1 Apps with Mobile Services

The User objectUser.level

AnonymousAuthenticatedAdmin

User.userIdProvider:id or undefined

User.getIdentities()UserIdProvider Access Token / Secret

Page 16: Building Windows 8.1 Apps with Mobile Services

demo

Adding Authentication

Page 17: Building Windows 8.1 Apps with Mobile Services

More on script options: Custom APINon-table based scriptsAccessible from

GetPostPutPatchDelete

Same permissions as tables

Page 18: Building Windows 8.1 Apps with Mobile Services

demo

Custom API

Page 19: Building Windows 8.1 Apps with Mobile Services

Diagnostics, Logging, Scale

DiagnosticsAPI callsCPU TimeData Out

Loggingconsole.error(…)console.log(…)

Scale - ComputeScale out instance countScale up VM size

Scale - StorageScale out mobile service tenant to dedicated SQL DBScale up SQL DB capacity

Page 20: Building Windows 8.1 Apps with Mobile Services

Service ScaleFree

500K API calls per subscription per month

Standard1.5M API calls per unit per month

Premium15M API calls per unit per month

Page 21: Building Windows 8.1 Apps with Mobile Services

demo

Diagnostics, Logging, Scale

Page 22: Building Windows 8.1 Apps with Mobile Services

Mobile Services Tiersusage & licensing $ service level

agreements

General Availability99.9%

Free Standard Premium

Usage Restrictions

Up to 10 services,Up to 500 Active

Devices*

N/A N/A

API Calls 500K (per subscription)

1.5M(per unit)

15M(per unit)

Scale N/A Up to 6 Standard units

Up to 10 Enterprise units

Scheduled Jobs

Limited Included Included

SQL Database (required)

20MB Included, Standard rates apply for more capacity

20MB Included, Standard rates apply

for more capacity

20MB Included, Standard rates apply for more capacity

*Active devices refers to the number of physical devices and emulators that make at least one call to or receive a push notification from your mobile service.

Page 23: Building Windows 8.1 Apps with Mobile Services

Windows Azure Mobile Services

Data

Notifications

Auth

Server Scripts + Custom API

Scheduler

Logging & Diag

Scale

Page 24: Building Windows 8.1 Apps with Mobile Services

ResourcesVideos, Tutorials, Code Samples and More

http://www.windowsazure.com/mobile

Microsoft Virtual Academy

http://bit.ly/1hYwvaq

Get a Windows Azure Free Trial Account

http://www.windowsazure.com

Help with Mobile Services

Q&A Forum: Windows Azure Mobile Services Forum

Feedback: [email protected]

Page 25: Building Windows 8.1 Apps with Mobile Services

Questions?

[email protected]

@KenCenerelli kencenerelli.wordpress.com

Page 26: Building Windows 8.1 Apps with Mobile Services

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.