A Hitchhiker's Guide to Azure Mobile Apps David Giard Microso. - - PowerPoint PPT Presentation

a hitchhiker s guide to azure mobile apps david giard
SMART_READER_LITE
LIVE PREVIEW

A Hitchhiker's Guide to Azure Mobile Apps David Giard Microso. - - PowerPoint PPT Presentation

A Hitchhiker's Guide to Azure Mobile Apps David Giard Microso. Technical Evangelist @DavidGiard DavidGiard.com TechnologyAndFriends dGiard@microso..com @DavidGiard This presenta<on is dedicated to Bill Fink @DavidGiard


slide-1
SLIDE 1

A Hitchhiker's Guide to Azure Mobile Apps

slide-2
SLIDE 2

@DavidGiard

David Giard

  • Microso. Technical Evangelist
  • @DavidGiard
  • DavidGiard.com
  • TechnologyAndFriends
  • dGiard@microso..com
slide-3
SLIDE 3

@DavidGiard

This presenta<on is dedicated to Bill Fink

slide-4
SLIDE 4

@DavidGiard

This presenta<on is dedicated to Bill Fink

slide-5
SLIDE 5

@DavidGiard

Agenda

  • Why Azure Mobile Apps?
  • Mobile Architecture
  • Common Data Access
  • CustomizaCon
  • Dynamic Data
  • Client Code
  • IdenCty and Permissions
  • Scaling
  • API Scripts
  • NoCficaCons
slide-6
SLIDE 6

@DavidGiard

Why Azure Mobile Apps?

  • Integrate with
  • Web Apps
  • Logic Apps
  • API Apps
  • All features of Web Apps
slide-7
SLIDE 7

@DavidGiard

Why Azure Mobile Services?

  • Frees you from plumbing code
  • Handles API Changes
  • Cross-PlaNorm soluCon
  • Choose JavaScript or .NET
slide-8
SLIDE 8

@DavidGiard

Mobile Architecture

Phone

Data Tablet or PC

iPhone

iPad

Android

JavaScript REST API

Phone

slide-9
SLIDE 9

@DavidGiard Permissions

Pieces of Azure Mobile Apps

SQL Server table READ INSERT UPDATE DELETE IdenCty Client Code

slide-10
SLIDE 10

@DavidGiard

Crea<ng a Mobile App

slide-11
SLIDE 11

@DavidGiard

Crea<ng a Mobile App

slide-12
SLIDE 12

@DavidGiard

REST

hSps://Giard.azurewebsites.net/Tables/Table1 hSps://mymobileapp-code.azurewebsites.net/Tables/Table1

  • GET, PUT, POST, DELETE, PATCH
  • Extend GET with oData Query syntax
slide-13
SLIDE 13

@DavidGiard

REST

HTTP Verb Ac+on SQL GET Read Data SELECT… POST Create Data INSERT… DELETE Delete Data DELETE… PUT or PATCH Update Data UPDATE…

slide-14
SLIDE 14

@DavidGiard

REST

Client Endpoint Request VERB (POST) Data (JSON) Response

slide-15
SLIDE 15

@DavidGiard

REST

Client Endpoint Request Response VERB (GET) Data (JSON)

slide-16
SLIDE 16

@DavidGiard

  • Data Query Syntax

Extension Descrip+on $filter WHERE clause $inlinecount # items in table $orderby SORT clause $select Columns to return $skip #records to skip $top #records to return ../Tables/Table1?$filter=state eq IL ../Tables/Table1?$filter=state eq IL&$orderby=LastName

slide-17
SLIDE 17

@DavidGiard

Dynamic Schema

  • AutomaCcally adds columns if matching data submiSed
  • Useful during development
  • Turn off during producCon
slide-18
SLIDE 18

@DavidGiard

Permissions

slide-19
SLIDE 19

@DavidGiard

Demo

slide-20
SLIDE 20

@DavidGiard

Iden<ty – Single Sign-On

Client Azure Mobile App API TwiSer

  • r Facebook
  • r Google
  • r Microso.

Request

TOKEN

slide-21
SLIDE 21

@DavidGiard

Iden<ty

slide-22
SLIDE 22

@DavidGiard

Iden<ty

funcCon insert(item, user, request) { item.CreatedBy = user.userId; request.execute(); } funcCon read(query, user, request) { query.where ({CreatedBy:user.userId}); request.execute(); }

slide-23
SLIDE 23

@DavidGiard

Demo

slide-24
SLIDE 24

@DavidGiard

Scaling

slide-25
SLIDE 25

@DavidGiard

Scaling

slide-26
SLIDE 26

@DavidGiard

API Scripts

slide-27
SLIDE 27

@DavidGiard

API Scripts

exports.post = funcCon(request, response) { // Use "request.service" to access features of your mobile service, e.g.: // var tables = request.service.tables; // var push = request.service.push; response.send(statusCodes.OK, { message : 'Hello World!' }); }; exports.get = funcCon(request, response) { response.send(statusCodes.OK, { message : 'Hello World!' }); };

<Mobile Service URL>/api/<API Name> hSps://giard.azure-mobile.net/api/MyApi

slide-28
SLIDE 28

@DavidGiard

Mobile Apps in .NET

slide-29
SLIDE 29

@DavidGiard

Mobile Apps in .NET

slide-30
SLIDE 30

@DavidGiard

Demo

slide-31
SLIDE 31

@DavidGiard

Push No<fica<ons

slide-32
SLIDE 32

@DavidGiard

Push No<fica<ons

App Push Service

APN (Apple) GCM (Google) WNS (Windows 8) MPNS (Windows Phone)

Azure Mobile Services var payload = '<?xml version="1.0" encoding="uN-8"?><toast><visual><binding template="ToastText01">' + '<text id="1">Sample Toast</text></binding></visual></toast>'; var push = request.service.push; push.wns.send(null, payload, 'wns/toast', { success: funcCon (pushResponse) { console.log("Sent push:", pushResponse); } }); }

slide-33
SLIDE 33

@DavidGiard Azure Mobile Services

Push No<fica<ons

Push Service

APN (Apple) GCM (Google) WNS (Windows 8) MPNS (Windows Phone)

NoCficaCon Hub +nyurl.com/PushNo+

slide-34
SLIDE 34

@DavidGiard

Push No<fica<on on Windows 8 & WP8

  • 1. Create Mobile Service
  • 2. Write Client App
  • 1. Associate app with store
  • 2. Get Package SID and Client ID from Live Services. Copy to Mobile Service.
  • 3. Register noCficaCons channel in OnLaunched (App.xaml.cs)
  • 4. Enable Toast noCficaCons (Package.appxmanifest)
  • 3. Update service to send Push NoCficaCon

+nyurl.com/Win8Push

slide-35
SLIDE 35

@DavidGiard

So Long and Thanks!

David Giard

  • @DavidGiard
  • DavidGiard.com
  • TechnologyAndFriends.com
  • channel9.msdn.com/niners/dgiard