building windows phone apps with mobile services speaker name speaker title speaker company email:...

32
Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Upload: tyler-ball

Post on 08-Jan-2018

236 views

Category:

Documents


0 download

DESCRIPTION

What is Mobile Services?

TRANSCRIPT

Page 1: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Building Windows Phone Apps with Mobile ServicesSpeaker NameSpeaker TitleSpeaker Company

Email:Twitter:

Page 2: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

AgendaMobile Services

Push Notifications

Data Storage

Security and Authentication

Other Features and Scaling

Questions

Page 3: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

What is Mobile Services?

Data

Notifications

Auth

Server Scripts

Scheduler

Logging & Diag

Scale

Page 4: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demoGetting Started

Page 5: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

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 Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

The REST API

Action HTTP Verb URL SuffixCreate POST /TodoItemRead GET /TodoItem?$filter=id%3D42Update PATCH /TodoItem/idDelete DELETE /TodoItem/id

Data Operations and their REST Equivalents

Base REST API Endpoint URLhttps://Mobileservice.azure-mobile.net/tables/*

Page 7: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

JSON to SQL Type MappingsJSON Value T-SQL TypeNumeric values (integer, decimal, floating point)

Float(53)

Boolean BitDateTime DateTimeOffset(3)String Nvarchar(max)

Page 8: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

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 Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Node ModulesExtensibility through numerous included modules

request

console

push.*

mssql

statusCodes azure

sendgrid

pusher

twilio

Page 10: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demoAdding Server Scripts

Page 11: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Push Notification Lifecycle Overview 1. Request Channel URI

2. Register with your Cloud Service

3. Push Notification

Windows Phone

(1)

(2)

(3)

(3)

(1)

Page 12: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Push NotificationsSupport push for WNS, MPNS, APNS. For WP:Integrates with MPNS to provide Toast, Tile and Raw notificationspush.mpns.* provides:

clean easy object model to compose notificationspush.mpns.[sendFlipTile(..) | sendTile(..) | sendToast(..) |

sendRaw(..)]

Page 13: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demoPush Notifications

Page 14: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

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 Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

The User objectUser.level

AnonymousAuthenticatedAdmin

User.userIdProvider:id or undefined

User.getIdentities()UserIdProvider Access Token / Secret

Page 16: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demoAdding Authentication

Page 17: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Custom APINon-table based scriptsAccessible from

GetPostPutPatchDelete

Same permissions as tables

Page 18: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Using the SchedulerExecute scripts on a scheduleExecute scripts on demandFrequency and length of execution based

off of service levelIdeal for backend data processing

Page 19: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Script Source ControlHandled through GIT repo• Access to table, scheduler, custom API, shared

scripts, and permissionsShared Scripts• Make scripts accessible from other scripts• Just like creating Node.js modulesNPM• Ability to use ‘npm install module’ to download

NPM modules

Page 20: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demo

Scheduler, Script Source Control, Custom API, NPM

Page 21: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Command Line ToolsScriptable control from PowerShell / Bash

Create / Delete Services

Create / Update / Delete Tables and Permissions

Inspect / Delete Table Data

Create, / Upload / Delete Scripts

Scale Up / Down Services Much More!

Page 22: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demoUsing the CLI

Page 23: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Diagnostics, Logging, Scale

API Calls, Devices, Data Out

Console logging from Scripts

Scale service based off of API Calls

Scale SQL DB / Server

Page 24: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

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 25: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

demo

Diagnostics, Logging, Scale

Page 26: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Mobile Services Tiersusage & licensing $ service level

agreementsGeneral 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 27: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Windows Azure Mobile Services

Data

Notifications

Auth

Server Scripts

Scheduler

Logging & Diag

Scale

Page 28: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

ResourcesGet a Windows Azure Free Trial Accounthttp://www.windowsazure.com

Videos, Tutorials, and Morehttp://www.windowsazure.com/mobile

Source code on GitHubhttps://github.com/WindowsAzure/azure-mobile-services

Contact [email protected] Requests

Page 29: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

© 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.

Page 30: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

API AuthorizationREST

API

SCRIPTS

SECURITYAdmin

App Key

Everyone

APP Key?

MasterKey?

*Passes App Key / Auth user rescritions

*should only be used during dev

403 on deny

Page 31: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

Authenticated Users

APP

REST

API

SCRIPTS

SECURITY

Valid User ID

+ Token

User ID +Auth Token

Provider

Token

Page 32: Building Windows Phone Apps with Mobile Services Speaker Name Speaker Title Speaker Company Email: Twitter:

OAuth Authentication Flow