Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Azure mobile apps

273 views

Published on

The basics of Azure Mobile Apps

Published in: Technology
  • John Buffi is a retired police offer who lost his home to Superstorm Sandy. He now uses the "Demolisher" system to help take care of his 91-year-old father and children. John says: "My only statement is "WOW"...I thought your other systems were special but this is going to turn out to be the " Holy Grail" of all MLB systems, no doubt! ➤➤ http://t.cn/A6zP24pL
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Azure mobile apps

  1. 1. A Hitchhiker's Guide to Azure Mobile Apps
  2. 2. @DavidGiard David Giard Microsoft Technical Evangelist • @DavidGiard • DavidGiard.com • TechnologyAndFriends • dGiard@microsoft.com
  3. 3. @DavidGiard Agenda • Why Azure Mobile Apps? • Mobile Architecture • Common Data Access • Customization • Dynamic Data • Client Code • Identity and Permissions • Scaling • API Scripts • Notifications
  4. 4. @DavidGiard Why Azure Mobile Apps? • Create and maintain back-end data store • Frees you from plumbing code • Handles API Changes • Cross-Platform solution • Choose JavaScript or .NET
  5. 5. @DavidGiard Why Azure Mobile Apps? • Integrate with • Web Apps • Logic Apps • API Apps • All features of Web Apps
  6. 6. @DavidGiard Mobile Architecture Phone Data Tablet or PC iPhone iPad Android JavaScript REST APIPhone
  7. 7. @DavidGiard Permissions Pieces of Azure Mobile Apps SQL Server table READ INSERT UPDATE DELETE IdentityClient Code
  8. 8. @DavidGiard REST https://Giard.azurewebsites.net/Tables/Table1 https://mymobileapp-code.azurewebsites.net/Tables/Table1 • GET, PUT, POST, DELETE, PATCH • Extend GET with oData Query syntax
  9. 9. @DavidGiard REST HTTP Verb Action SQL GET Read Data SELECT… POST Create Data INSERT… DELETE Delete Data DELETE… PUT or PATCH Update Data UPDATE…
  10. 10. @DavidGiard REST Client Endpoint Request Response VERB (GET) Data (JSON)
  11. 11. @DavidGiard REST Client Endpoint Request VERB (POST) Data (JSON) Response
  12. 12. @DavidGiard oData Query Syntax Extension Description $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
  13. 13. @DavidGiard Dynamic Schema • Automatically adds columns if matching data submitted • Useful during development • Turn off during production
  14. 14. @DavidGiard Permissions
  15. 15. @DavidGiard Demo
  16. 16. @DavidGiard Identity – Single Sign-On Client Azure Mobile App API Twitter or Facebook or Google or Microsoft TOKEN
  17. 17. @DavidGiard Identity function insert(item, user, request) { item.CreatedBy = user.userId; request.execute(); } function read(query, user, request) { query.where ({CreatedBy:user.userId}); request.execute(); }
  18. 18. @DavidGiard Demo
  19. 19. @DavidGiard Scaling
  20. 20. @DavidGiard Scaling
  21. 21. @DavidGiard API Scripts
  22. 22. @DavidGiard API Scripts exports.post = function(request, response) { // Use "request.service" to access features of your Mobile App, e.g.: // var tables = request.service.tables; // var push = request.service.push; response.send(statusCodes.OK, { message : 'Hello World!' }); }; exports.get = function(request, response) { response.send(statusCodes.OK, { message : 'Hello World!' }); }; <Mobile App URL>/api/<API Name> https://giard.azure-mobile.net/api/MyApi
  23. 23. @DavidGiard Demo
  24. 24. @DavidGiard Push Notifications
  25. 25. @DavidGiard Push Notifications App Push Service APN (Apple) GCM (Google) WNS (Windows 8) MPNS (Windows Phone) Azure Mobile Apps var payload = '<?xml version="1.0" encoding="utf-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: function (pushResponse) { console.log("Sent push:", pushResponse); } }); }
  26. 26. @DavidGiard Azure Mobile Apps Push Notifications Push Service APN (Apple) GCM (Google) WNS (Windows 8) MPNS (Windows Phone) Notification Hub tinyurl.com/PushNoti
  27. 27. @DavidGiard Push Notification on Windows 8 & WP8 1. Create Mobile App 2. Write Client App 1. Associate app with store 2. Get Package SID and Client ID from Live Services. Copy to Mobile App. 3. Register notifications channel in OnLaunched (App.xaml.cs) 4. Enable Toast notifications (Package.appxmanifest) 3. Update service to send Push Notification tinyurl.com/Win8Push
  28. 28. @DavidGiard So Long and Thanks! David Giard • @DavidGiard • DavidGiard.com • TechnologyAndFriends.com • channel9.msdn.com/niners/dgiard

×