Building a chat app with
Windows Azure Mobile Services
29 march 2014, Timisoara
Global Windows Azure Bootcamp
Flavius Radu Demian
Software developer, Avaelgo
I really like programming, especially web and mobile
Please feel free to a...
Expectations
Learn how to use mobile services
Learn when to use mobile services
Learn the strengths and limitations of mob...
Agenda
Overview
Storage
Custom API
Authentication & Authorization
Scheduler
Diagnostics & Logging
Scale
Cool Third Party A...
A visual representation
Overview
Clients for:
Windows Store, Windows Phone 8, iOS, Android, Javascript
You can add a cloud backend to your app in ...
Overview
Easily manipulate data (filters)
Easily authenticate users
Send push notifications
Integrate your favorite servic...
Server side logic
Node.js
Is a software platform for scalable server-side and networking
applications
Applications are wri...
Storage
Windows Azure SQL Database
Dynamic schema on/off
REST API generated per table -> Data centric platform
Access your...
Storage
JSON to SQL data types conversions
“Data Centric” Server Logic
Backend runs Node JS on small azure VM’s
“Interceptors” exposed for all CRUD requests to all t...
Custom API
You can write your own API very easily and quickly
If you need you can add extra Node JS packages
exports.get =...
Small demo time part 1
Login in the portal and create a mobile service
Set GIT credentials and get repository
Create some ...
Push notifications
The notification provider server maintains a "persistent IP
connection" with your device in order to de...
Push notifications
Platform specific providers:
Push notifications overview
1) The app requests a channel from the
Notifications Provider
2) The app sends the channel url...
Authentication & Authorization
You can make provide quick auth in your app with
Facebook Twitter Google Microsoft
and Wind...
Authorization
Table level authorization for CRUD operation
Everyone -> any request by anyone is accepted
Anyone with Appli...
Authorization
Table level authorization for CRUD operation (*cont)
Scripts and Admins -> registers scripts or requests via...
Scheduler
Run jobs on simple or complex recurring schedules such as:
1) Send broadcast push notifications
2) Processing or...
Diagnostics and Logging
View diagnostics directly in the portal including :
1) API calls
2) CPU time
3) Data Out
LoggingCo...
Scale
Compute - scale between shared and reserved mode
Increase/decrease your instance count
Storage ability to scale out ...
Small demo time part 2
Push notifications
Authentication
Authorization
Diagnostics
Logging
Scale
Cool Third Party Add-Ons
Real time communication Emails SMS
Design - Database
Tables: users, channels, messages
Channel
ChannelUri
RegistrationId
UserProviderId
DeviceType
Message
Fr...
Design - Functionalities
Integrate Azure Mobile Services
Integrate with social media providers
Store data to cloud after a...
Design – send push to web
Let’s show some code
But first let’s see a short teaser
Review of Azure Mobile Services
Create a scalable and secure backend for your Windows, Android
and iOS apps
Store data in ...
Review of Azure Mobile Services
Consume your favorite services
Monitor, alert, and auto scale
Cheap and FREE in some cases...
Thanks
Any questions?
Upcoming SlideShare
Loading in …5
×

Building a chat app with windows azure mobile

1,265 views
991 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,265
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Building a chat app with windows azure mobile

  1. 1. Building a chat app with Windows Azure Mobile Services 29 march 2014, Timisoara Global Windows Azure Bootcamp
  2. 2. Flavius Radu Demian Software developer, Avaelgo I really like programming, especially web and mobile Please feel free to ask questions any time and don’t be shy Knowledge is power  flaviusdemian91@yahoo.com | flavius.demian@gmail.com | @slowarad
  3. 3. Expectations Learn how to use mobile services Learn when to use mobile services Learn the strengths and limitations of mobile services Learn that mobile services wants to be friend with everyone Make you curious  => go home and play with it
  4. 4. Agenda Overview Storage Custom API Authentication & Authorization Scheduler Diagnostics & Logging Scale Cool Third Party Add-Ons Design of the chat app Review
  5. 5. A visual representation
  6. 6. Overview Clients for: Windows Store, Windows Phone 8, iOS, Android, Javascript You can add a cloud backend to your app in minutes without the need for server code The backend login can be written in node.js or c# (preview) The SDK’s are open source (on github) , it’s integrated with GIT
  7. 7. Overview Easily manipulate data (filters) Easily authenticate users Send push notifications Integrate your favorite services Great community
  8. 8. Server side logic Node.js Is a software platform for scalable server-side and networking applications Applications are written in JavaScript can be run within the Node.js runtime on Windows, Mac OS X and Linux with no changes It is written in
  9. 9. Storage Windows Azure SQL Database Dynamic schema on/off REST API generated per table -> Data centric platform Access your data through : Portal, SQL Management Studio, Rest API
  10. 10. Storage JSON to SQL data types conversions
  11. 11. “Data Centric” Server Logic Backend runs Node JS on small azure VM’s “Interceptors” exposed for all CRUD requests to all tables You get access to a predefined set of node modules : request, console, push.*, tables, statusCodes, azure, mssql
  12. 12. Custom API You can write your own API very easily and quickly If you need you can add extra Node JS packages exports.get = function(req, res) { /* code here */ } exports.post = function(req, res) {/* code here */ }
  13. 13. Small demo time part 1 Login in the portal and create a mobile service Set GIT credentials and get repository Create some tables, show interceptors Create a custom API See list of predefined packages -> click here
  14. 14. Push notifications The notification provider server maintains a "persistent IP connection" with your device in order to deliver notifications when the app needs to 'say' something to you. Payload limited, specific to platform The global push object is used to send push notifications Success and Error callbacks are provided
  15. 15. Push notifications Platform specific providers:
  16. 16. Push notifications overview 1) The app requests a channel from the Notifications Provider 2) The app sends the channel url to Mobile Services which stores it 3) When a notification is sent, Mobile Services executes something like this: push.mpns.send(channelUri….) Windows Phone case study 4) The notification goes through the Notifications Provider which forwards it to the device
  17. 17. Authentication & Authorization You can make provide quick auth in your app with Facebook Twitter Google Microsoft and Windows Azure Active Directory
  18. 18. Authorization Table level authorization for CRUD operation Everyone -> any request by anyone is accepted Anyone with Application Key -> app key is sent on the request distributed (default) Authenticated Users -> users authenticated with one of the mentioned identity providers
  19. 19. Authorization Table level authorization for CRUD operation (*cont) Scripts and Admins -> registers scripts or requests via the master key The application key is not secure and should not be used to authenticate users of your app, especially in production
  20. 20. Scheduler Run jobs on simple or complex recurring schedules such as: 1) Send broadcast push notifications 2) Processing or resizing stored images Invoking a Web Service over HTTP/s Post a message to a Windows Azure Storage Queue, etc
  21. 21. Diagnostics and Logging View diagnostics directly in the portal including : 1) API calls 2) CPU time 3) Data Out LoggingConsole.* operations like console.log and console.error provide an easy means to debug your server side scripts.
  22. 22. Scale Compute - scale between shared and reserved mode Increase/decrease your instance count Storage ability to scale out your mobile service tenant(s) to a dedicated SQL DB Ability to scale up your SQL DB from web through business to 150GB
  23. 23. Small demo time part 2 Push notifications Authentication Authorization Diagnostics Logging Scale
  24. 24. Cool Third Party Add-Ons Real time communication Emails SMS
  25. 25. Design - Database Tables: users, channels, messages Channel ChannelUri RegistrationId UserProviderId DeviceType Message FromId ToId DeviceType FromName FromPicture User ProviderId Name Picture AccessToken AccessTokenSecret
  26. 26. Design - Functionalities Integrate Azure Mobile Services Integrate with social media providers Store data to cloud after auth ( user and channel related data ) Retrieve the rest of the users you can talk to (custom API) Send message functionality Receive message functionality Logout functionality
  27. 27. Design – send push to web
  28. 28. Let’s show some code But first let’s see a short teaser
  29. 29. Review of Azure Mobile Services Create a scalable and secure backend for your Windows, Android and iOS apps Store data in the cloud Easily authenticate users Send push notifications
  30. 30. Review of Azure Mobile Services Consume your favorite services Monitor, alert, and auto scale Cheap and FREE in some cases -> click here Preview: No availability Service Level Agreement Paid: General Availability: 99.9%
  31. 31. Thanks Any questions?

×