a hitchhiker s guide to azure mobile apps david giard
play

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


  1. A Hitchhiker's Guide to Azure Mobile Apps

  2. David Giard Microso. Technical Evangelist • @DavidGiard • DavidGiard.com • TechnologyAndFriends • dGiard@microso..com @DavidGiard

  3. This presenta<on is dedicated to Bill Fink @DavidGiard

  4. This presenta<on is dedicated to Bill Fink @DavidGiard

  5. Agenda • Why Azure Mobile Apps? • Mobile Architecture • Common Data Access • CustomizaCon • Dynamic Data • Client Code • IdenCty and Permissions • Scaling • API Scripts • NoCficaCons @DavidGiard

  6. Why Azure Mobile Apps? • Integrate with • Web Apps • Logic Apps • API Apps • All features of Web Apps @DavidGiard

  7. Why Azure Mobile Services? • Frees you from plumbing code • Handles API Changes • Cross-PlaNorm soluCon • Choose JavaScript or .NET @DavidGiard

  8. Mobile Architecture Phone REST Data API Phone Tablet or PC iPad JavaScript iPhone Android @DavidGiard

  9. Pieces of Azure Mobile Apps Permissions READ INSERT IdenCty Client Code SQL Server table UPDATE DELETE @DavidGiard

  10. Crea<ng a Mobile App @DavidGiard

  11. Crea<ng a Mobile App @DavidGiard

  12. 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 @DavidGiard

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

  14. REST VERB (POST) Request Data Client (JSON) Endpoint Response @DavidGiard

  15. REST VERB (GET) Request Client Endpoint Response Data (JSON) @DavidGiard

  16. oData 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 @DavidGiard

  17. Dynamic Schema • AutomaCcally adds columns if matching data submiSed • Useful during development • Turn off during producCon @DavidGiard

  18. Permissions @DavidGiard

  19. Demo @DavidGiard

  20. Iden<ty – Single Sign-On TwiSer or Facebook or Google or Microso. TOKEN Request Client Azure Mobile App API @DavidGiard

  21. Iden<ty @DavidGiard

  22. 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(); } @DavidGiard

  23. Demo @DavidGiard

  24. Scaling @DavidGiard

  25. Scaling @DavidGiard

  26. API Scripts @DavidGiard

  27. API Scripts <Mobile Service URL>/api/<API Name> hSps://giard.azure-mobile.net/api/MyApi 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!' }); }; @DavidGiard

  28. Mobile Apps in .NET @DavidGiard

  29. Mobile Apps in .NET @DavidGiard

  30. Demo @DavidGiard

  31. Push No<fica<ons @DavidGiard

  32. Push No<fica<ons var payload = Azure '<?xml version="1.0" encoding="uN-8"?><toast><visual><binding template="ToastText01">' + Mobile App '<text id="1">Sample Toast</text></binding></visual></toast>'; Services var push = request.service.push; push.wns.send(null, payload, 'wns/toast', { success: funcCon (pushResponse) { console.log("Sent push:", pushResponse); Push Service } APN (Apple) }); GCM (Google) WNS (Windows 8) } MPNS (Windows Phone) @DavidGiard

  33. Push No<fica<ons Azure Mobile Services Push Service NoCficaCon APN (Apple) GCM (Google) Hub +nyurl.com/PushNo+ WNS (Windows 8) MPNS (Windows Phone) @DavidGiard

  34. 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 @DavidGiard

  35. So Long and Thanks! David Giard • @DavidGiard • DavidGiard.com • TechnologyAndFriends.com • channel9.msdn.com/niners/dgiard @DavidGiard

Recommend


More recommend