40
Windows Azure Mobile Services from Start to REST MTUG.ie Windows azure group #irishazureheads April 2013

Windows azure mobile services from start to rest

Embed Size (px)

DESCRIPTION

slidedeck for a talk at the Microsoft Technology User Group on April 18th 2013.

Citation preview

Page 1: Windows azure mobile services from start to rest

Windows Azure Mobile Services from Start to REST

MTUG.ie Windows azure group #irishazureheads

April 2013

Page 2: Windows azure mobile services from start to rest

Aidan CaseySolutions architect @MYOB Australia

[email protected] | @AIDANJCASEY | acaseyblog.wordpress.com

Page 3: Windows azure mobile services from start to rest

Agenda Overview

Storage

Push Notifications

Authentication & Authorisation

Scheduler

Diagnostics & Scale

Prize Giveaway!

Questions & Answers

Page 4: Windows azure mobile services from start to rest

Data

Auth Server Logic Scheduler

Logging & Diag

Scale

Notifications

Page 5: Windows azure mobile services from start to rest

SDK’s• Windows Store

• Windows Phone 8

• iOS

• Android

• JavaScript

All SDK’s are open sourced..

github.com/WindowsAzure/azure-mobile-services

Page 6: Windows azure mobile services from start to rest

What we are gonna build tonight

Page 7: Windows azure mobile services from start to rest
Page 8: Windows azure mobile services from start to rest

The swag that’s up for grabs!

Page 9: Windows azure mobile services from start to rest

DemoCREATING A NEW MOBILE SERVICES STACK & TWEET AGGREGATOR

Page 10: Windows azure mobile services from start to rest

Storage

Data

Page 11: Windows azure mobile services from start to rest

Structured Storage Windows Azure SQL Database

Dynamic schema on/off

Apps partitioned by schema

REST API generated per table (very data centric platform)

Access your data through the portal, SQL Management studio or REST API

Page 12: Windows azure mobile services from start to rest

JSON -> SQL data typesJSON value T-SQL type

Numeric values (integer, decimal, floating point) Float(53)

Boolean Bit

DateTime DateTimeOffset(3)

String Nvarchar(max)

Page 13: Windows azure mobile services from start to rest

DemoJAVASCRIPT SDK

Page 14: Windows azure mobile services from start to rest

Server side Logic

Page 15: Windows azure mobile services from start to rest

“Data Centric” Server LogicBackend runs Node.js on small azure VM’s

“Interceptors” exposed for all CRUD requests to all tables

You only get access to a predefined set of node modules

Third party apps exposed through node modules (sendgrid, twilio, pusher)

request, console, push.*, tables, sql, statusCodes, azure, mssql

Page 16: Windows azure mobile services from start to rest

Unstructured Storage “Virtual Tables” let you short-circuit the database entirely

E.g. offload to Azure table storage, azure blob storage, service bus queues !

var azure = require('azure');var accountName = '<storage-account-name>';var accountKey = '<storage-account-key>';var host = accountName + '.blob.core.windows.net';var blobService = azure.createBlobService(accountName, accountKey, host);

Page 17: Windows azure mobile services from start to rest

DemoINTERCEPTORS AND SENDING EMAILS WITH SENDGRID

Page 18: Windows azure mobile services from start to rest

Notifications

Notifications

Page 19: Windows azure mobile services from start to rest

Push Notifications The global push object is used to send push notifications.

Success & Error Callbacks are provided

Method

push. apns Apple Push Notification Service iOS apps

push. gcm Google Cloud Messaging Android apps

push. mpns Microsoft Push Notification Service Windows Phone 8 apps

push. wns Windows Notification Services Windows Store apps

Page 20: Windows azure mobile services from start to rest

Push Notification Lifecycle

1. register app for push notifications

2. register the apple send token to Mobile Service

3. Server side script

push.apns(…)(1)

(2)

(3)

(3)

iOS

Page 21: Windows azure mobile services from start to rest

DemoPUSH NOTIFICATIONS TO A WINDOWS STORE APP

Page 22: Windows azure mobile services from start to rest

Authentication & Authorisation

Auth

Page 23: Windows azure mobile services from start to rest
Page 24: Windows azure mobile services from start to rest

AuthorisationTable level authorization for CRUD operations

Everyone: any request by anyone is accepted.Anyone with Application Key: app key distributed w/ the app (default)Authenticated Users: users authenticated by Live Connect.Scripts and Admins: registered scripts or requests via the master key

Application Key should not be used in production !

Page 25: Windows azure mobile services from start to rest

CLI & Diagnostics

Page 26: Windows azure mobile services from start to rest

Command line tools Can do “most things” from the command line

Create/ Delete a new mobile service

Create / Delete a table

Register table scripts

list tables/ mobile services

No access to the scheduler from the command line

Page 27: Windows azure mobile services from start to rest

Scheduler

Scheduler

Page 28: Windows azure mobile services from start to rest

DemoSCHEDULED TASK TO STORE TWEETS TO #IRISHAZUREHEADS

Page 29: Windows azure mobile services from start to rest

DemoUSING THE REST API

Page 30: Windows azure mobile services from start to rest

Cool Third Party Add-Ons

Page 31: Windows azure mobile services from start to rest

Running on shared instances

10 Mobile Services

1GB SQL Database

Data transfer is per subscription, not per mobile service

Unlimited ingress

165MB daily egress

Scheduler

700 jobs a month

Free offer for current preview release

Page 32: Windows azure mobile services from start to rest

Show me the money!pricing & licensing $ service level

agreements

PreviewNo availability SLA

General Availability99.9%

Shared Instance (multitenant environment)

Small instance is the only size available; multiple may be purchased

Free at public preview launch

Up to 10 applications

Reserved Instance (private VM)

Small instance is the only size available; multiple may be purchased

Charge for Preview will be at the same reduced rate as azure websites

Up to 10 applications

Page 33: Windows azure mobile services from start to rest

Thanks to our sponsors

Page 34: Windows azure mobile services from start to rest

Competition Time!

github.com/aidancasey/AzureMobileServicesGiveAway

Page 35: Windows azure mobile services from start to rest

tweets to -

#irishazureheads

register your details here -

azurecompetition.azurewebsites.net

*All personal details will be deleted afterwards

Page 36: Windows azure mobile services from start to rest

the swag …

Page 37: Windows azure mobile services from start to rest

DataAuth

Server Logic

Scheduler

Logging & Diag

Scale

Notifications

Page 38: Windows azure mobile services from start to rest

Resources Official Videos & Tutorials

http://www.windowsazure.com/en-us/develop/mobile/

Real world Use Cases & black belt tips

http://chrisrisner.com/Common-Scenarios-with-Windows-Azure-Mobile-Services

Mr Azure Mobile Services (Josh Twist)

http://www.thejoyofcode.com/

Cloud Nick ( Nick Harris )

http://www.nickharris.net/

Page 39: Windows azure mobile services from start to rest

MTUG needs you !

Page 40: Windows azure mobile services from start to rest

?