Windows Azure Mobile Services - The Perfect Partner

34
Windows Azure Mobile Services: The Perfect Partner! M3 October 26 th , 2012

description

 

Transcript of Windows Azure Mobile Services - The Perfect Partner

Page 1: Windows Azure Mobile Services - The Perfect Partner

Windows Azure Mobile Services: The Perfect Partner!M3

October 26th, 2012

Page 2: Windows Azure Mobile Services - The Perfect Partner

National Architect,

Windows Azure

[email protected]

@MichaelCollier

www.MichaelSCollier.com

Michael Collier

Page 3: Windows Azure Mobile Services - The Perfect Partner

What is the cloud?

An approach to computing that’s about internet scale and connecting to a variety of devices and endpoints

Image courtesy of Windows Azure Training Kit

Page 4: Windows Azure Mobile Services - The Perfect Partner

Elastic Scale

Near-infinite Capacity

Consumption-based Pricing

No Long-Term Commitments

High Reliability

Global Presence

Cloud Computing

vs.

Page 5: Windows Azure Mobile Services - The Perfect Partner

Mobility + Cloud == The Perfect Pair

Mobility Cloud

Limited Compute Virtually Limitless Compute

Limited Storage Virtually Limitless Storage

Connect from Anywhere Services via the internetStandards based accessible APIs

Rapidly Growing Market Scale and Elasticity

Page 6: Windows Azure Mobile Services - The Perfect Partner

Backend for Mobile Applications

Iden

tity

Str

uctu

red

Sto

rage

Mes

sagi

ng

Med

ia

Uns

truc

ture

d S

tora

ge

Windows Azure Mobile ServicesWindows Azure Mobile Services

Add

ition

al S

ervi

ces

Page 7: Windows Azure Mobile Services - The Perfect Partner

What is Windows Azure Mobile Services

Data

Notifications

Auth

Server Logic

Scale

Logging

Diagnostics

http://aka.ms/mobileservicesImage courtesy of Windows Azure Training Kit

Page 8: Windows Azure Mobile Services - The Perfect Partner

• Official SDKs for Windows 8 and iOS

• JavaScript library

• Android and Windows Phone coming soon

Client Support

Image courtesy of http://msdn.microsoft.com/en-us/library/windowsazure/jj554228

Page 9: Windows Azure Mobile Services - The Perfect Partner

demoGetting Started

Page 10: Windows Azure Mobile Services - The Perfect Partner

Application KeyNOT A SECURITY TOKEN/CONTROL

Hint that user is coming from your app (reduce chance of misuse)

Private until you publish the app

Master KeyAll powerful

Do NOT distribute with your application

Use from server-side logic you control

Security

Page 11: Windows Azure Mobile Services - The Perfect Partner

Leverage Windows Azure Storage

Tables: schemaless entity storage; NoSQL

Blobs: storage for any binary object (files . . . whatever you want)

Queues: simple messaging (push/pop)

Access via Windows Azure module for node.jsvar azure = require('azure');

var tableService = azure.createTableService(‘<storage account>',‘<storage key>', 'table.core.windows.net');

tableService.insertEntity(‘<table>’, entity, function(error) { });

Unstructured Data Storage

Page 12: Windows Azure Mobile Services - The Perfect Partner

Leverage strengths of Windows Azure SQL DatabaseNew or Existing Database

Reporting, TSQL support, existing tools, etc.

Manage your way (portal, REST API, SSMS, etc.)

Partition applications by schemaApp1.Users

App2.Users

Dynamic Schema Support (on/off)

Structured Data Storage

DB

Page 13: Windows Azure Mobile Services - The Perfect Partner

REST API

OData Interface

GET, POST, PATCH, DELETE

https://<service>.azure-mobile.net/tables/<table_name>/{<item_id>}

AuthorizationX-ZUM0-{APPLICATION | AUTH | MASTER}

Send JSON in request body

Receive JSON as response

Data Access

DB

Page 14: Windows Azure Mobile Services - The Perfect Partner

demoIt’s Your Data

Page 15: Windows Azure Mobile Services - The Perfect Partner

Never trust the client!

Handled via JavaScript scripts on the server

Intercept CRUD operations and apply your logic

Server-Side Business Logic

Pre

-Scr

iptin

g Scripting

Pre

-Sto

rage

DB

node.js

User authenticationPayload verification

Dynamic schematizationFinal checks

function(item, user, request) {…..}

Page 16: Windows Azure Mobile Services - The Perfect Partner

Known objects and modulesazure

sendgrid

console

mssql

push

statusCodes

table

request

crypto

util

node.js

var SendGrid = require('sendgrid').SendGrid;var sendgrid = new SendGrid(‘<account>', ‘<password>'); sendgrid.send({ to: userItem.EmailAddress, from: '[email protected]', subject: 'New ToDoItem Added!!', text: 'A new MyToDoItem was added: ' + item.text}, function(success, message) { // If the email failed to send, log it as an error. if (!success) { console.error('SendGrid Error! ' + message); } });

Page 17: Windows Azure Mobile Services - The Perfect Partner

Push Notifications

3. M

PNS sen

ds notic

e to

dev

ice 2. A

pp sends notice to MPN

S

1. Register channel with app

MicrosoftPushNotificationService

Mobile ServicesDevice

Page 18: Windows Azure Mobile Services - The Perfect Partner

Obtain WNS client secret and package SID from Windows dev portal.

Enter WNS information to Mobile Services portal.

Ability to send Tile, Toast, Badge, and Raw notifications.

push.wns.*Node.js module to create push notifications

Handles authentication against WNS

Push Notifications

Page 19: Windows Azure Mobile Services - The Perfect Partner

demoServer Scripts

Page 20: Windows Azure Mobile Services - The Perfect Partner

Microsoft Account – Use the Live SDKTight integration with Windows Live services

Authentication

Page 21: Windows Azure Mobile Services - The Perfect Partner

Microsoft Account, Facebook, Twitter, and Google

OAuth

Does not use Windows Azure ACS

Authentication

Page 22: Windows Azure Mobile Services - The Perfect Partner

Table level authorization for CRUD operationsEveryone: 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

Your application can add whatever other authorization is needed.

Authorization

Page 23: Windows Azure Mobile Services - The Perfect Partner

Server script to match against your table (role-based access, specific user, etc.)

Match against user.userId

Authorization

Page 24: Windows Azure Mobile Services - The Perfect Partner

demoAdding User Authentication

Page 25: Windows Azure Mobile Services - The Perfect Partner

• API Calls

• CPU Time

• Data Out

Diagnostics

Page 26: Windows Azure Mobile Services - The Perfect Partner

console objectlog(formatString, obj, .. .)

info(…)

warn(…)

error(…)

Logging

Page 27: Windows Azure Mobile Services - The Perfect Partner

ComputeScale out number of instances

Scale up the VM size

StorageDedicated SQL Database

Larger sized SQL Database

Scale

Page 28: Windows Azure Mobile Services - The Perfect Partner

demoDiagnostics, Logging, and Scale

Page 29: Windows Azure Mobile Services - The Perfect Partner

Official Android and Windows Phone SDKs coming soon

Official iOS SDK in Preview on GitHub

https://github.com/WindowsAzure/azure-mobile-services

CommunityWindows Phone: https://github.com/kenegozi/azure-mobile-csharp-sdk

MonoTouch (iOS and Android): https://github.com/xamarin/azure-mobile-services

ChrisRisner.com: Windows Azure Evangelist (iOS and Android)

REST API

Other Mobile Clients?

Page 30: Windows Azure Mobile Services - The Perfect Partner

Free Offer at Preview

Running on shared instances

10 Mobile Services 1GB SQL

Database

Must be deployed to US-East or US-West DC

Data transfer is per subscription, not per mobile service

No SLA during Preview. Only small instances available. Can upgrade to a reserved instance at 33% discount from normal Pay-As-You-Go rates during Preview.

From

WA

Free T

rial

Unlimited ingress

165MB daily egress

Source: Windows Azure Training Kit

Page 31: Windows Azure Mobile Services - The Perfect Partner

Pricing and SLAShared Instance Reserved InstanceMultitenant Environment Private VM (3 instance max)

Small Only (1.6GHz, 1.75 GB, 225 GB Storage)

10 mobile service applications 100 mobile service applicationsFree Same rate as Windows Azure Web

Sites

Service Level AgreementPreview – No availability SLAGA – 99.9%

Page 32: Windows Azure Mobile Services - The Perfect Partner

Summary

Data

Notifications

Auth

Server Logic

Scale

Logging

Diagnostics

http://aka.ms/mobileservices

Page 33: Windows Azure Mobile Services - The Perfect Partner

• Windows Azure Mobile Services– http://aka.ms/mobileservices

• SDK and Samples available on GitHub– https://github.com/WindowsAzure/azure-mobile-services

• Inside Windows Azure Mobile Services– http://

channel9.msdn.com/posts/Kirill-Gavrylyuk-and-Josh-Twist-Inside-Windows-Azure-Mobile-Services

• Josh Twist’s Blog– http://www.thejoyofcode.com

• Carlos Figueira’s Blog– http://blogs.msdn.com/b/carlosfigueira/

• Windows Azure FREE Trial– http://bit.ly/MikeAzureTrial

Resources

Page 34: Windows Azure Mobile Services - The Perfect Partner

Q &

A

Ask your questions