building windows 8.1 apps with mobile services
TRANSCRIPT
Building Windows 8.1 Apps with Mobile ServicesKen CenerelliSoftware DeveloperDesire2Learn
@KenCenerellikencenerelli.wordpress.com
Agenda
Mobile Services
Push Notifications
Data Storage
Auth*
Other Features and Scaling
Questions
What is Mobile Services?
Data
Notifications
Auth
Server Scripts + Custom API
Scheduler
Logging & Diag
Scale
demo
Getting Started
Structured StoragePowered by SQL DatabaseSame DB – Multiple Mobile Services
AppX.TodoitemAppY.Todoitem
Data management inWindows Azure PortalSQL Portal, SQL Management StudioREST APICLI Tools
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/*
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)
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
Node ModulesExtensibility through numerous included modules
request
console
push.*
mssql
statusCodes azure
sendgrid
pusher
twilio
demo
Adding Server Scripts
Push Notification Lifecycle Overview 1. Request Channel URI
2. Register with your Cloud Service
3. Authenticate & Push Notification
Windows 8
(1)
(2)
(3)
(3)
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
demo
Push Notifications
Made easy with the VS 2013 Wizard
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
The User objectUser.level
AnonymousAuthenticatedAdmin
User.userIdProvider:id or undefined
User.getIdentities()UserIdProvider Access Token / Secret
demo
Adding Authentication
More on script options: Custom APINon-table based scriptsAccessible from
GetPostPutPatchDelete
Same permissions as tables
demo
Custom API
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
Service ScaleFree
500K API calls per subscription per month
Standard1.5M API calls per unit per month
Premium15M API calls per unit per month
demo
Diagnostics, Logging, Scale
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.
Windows Azure Mobile Services
Data
Notifications
Auth
Server Scripts + Custom API
Scheduler
Logging & Diag
Scale
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]
© 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.