1. Antimo Musone
The Magic Box – Windows Azure Mobile
antimo.musone@avanade.com
@fifthelementproject.com
avanade italy – italian ingenium team
2. About Me
Antimo musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Technical Architect for Avanade
Microsoft Student Partner
Co-Founder of 5th Element Project
http://www.fifthelementproject.com
http://antimomusone.com
4. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
An approach to computing
that’s about internet scale
and connecting to a variety
of devices and endpoints
5. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Cloud Computing
IaaS
Infrastructure-
PaaS
Platform-as-a-
SaaS
Software-as-a-
as-a-Service Service Service
6. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Windows Azure
Comprehensive set of
services that enable you to
quickly build, deploy and
manage applications across a
global network of Microsoft-
managed datacenters
7. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Three Reasons for Device + Cloud
1 Allows new application
scenarios
2 The cloud levels the playing
field
3
The cloud provides a way to
reach across device
platforms and a larger pool
of resources from which to
pull
9. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Any pictures?
SAS Process Image
Windows Azure
Translated Text
Authenticate Token
Access Token
Job Completed
Job Completed
Access
Shared Access
Signature Translated
Send Image
Text
Translated
Text
Hawaii OCR &
Bing Translator
10. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Azure Mobile Features
13. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Interoperability Features
o Http Rest Interface
o OData
o JSON
o OAUTH
14. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Data Storage
15. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Data Storage - Technology
o REST API
o https://<service>.azuremobile.net/tables/<table_name>/{<item_id>}
o OData Interface
o HTTP METHOD GET, POST, PATCH, DELETE
o Request & Response use JSON in request body
16. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Data Storage – Authorization Level
o Authorization Header
o X-ZUMO-{ APPLICATION | AUTH | MASTER }
o Every Request Header has different X-ZUMO- Header
for different authorization
Everyone None
Anybody with the application key X-ZUMO-APPLICATION
Only Authenticated Users X-ZUMO-AUTH
Only Scripts and Admins X-ZUMO-MASTER
17. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Data Storage – Architecture
o Leverage strengths of Windows Azure SQL Database
o Reporting, TSQL support, existing tools, etc.
o Manage your way (portal, REST API, SSMS, etc.)
o Partition applications by schema
o App1.Users
o App2.Users
o Dynamic Schema Support (on/off)
18. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Data Storage – Example
o Request
Http Method : GET https://todolist.azuremobile.net/tables/TodoItem?
$filter=(complete%20eq%20false)
Header : Accept: application/json X-ZUMO-APPLICATION:
UzMAOXRlJdZyqibeUqCMoZZMrUXIRs92 Host: todolist.azure-mobile.net
o Response
HTTP/1.1 200 OK
[{"id":1,"text":"Sign-up for the free trial","complete":false},
{"id":2,"text":"Create the mobile service","complete":false },
{"id":3,"text":"Complete the quickstart","complete":false}]
19. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Business Logic
20. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Business Logic – Architecture
o Intercept CRUD operations and apply your logic with
JavaScript scripts node.js
Scripting
Scripting
function(item, user, request)
{ DB
DB
…..
}
User authentication Dynamic schematization
21. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Business Logic – Technology
o Known objects and modules
o azure var SendGrid = require('sendgrid').SendGrid;
var sendgrid = new SendGrid(‘<account>', ‘<password>');
o sendgrid
o console sendgrid.send({
o mssql to: userItem.EmailAddress,
from: 'notifications@mytodoitem.azure-mobile.net',
o push subject: 'New ToDoItem Added!!',
o statusCodes text: 'A new MyToDoItem was added: ' + item.text},
o table function(success, message)
{
o request // If the email failed to send, log it as an error.
o crypto if (!success) {
o console.error('SendGrid Error! ' + message);
util
}
});
23. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Authentication
Account: Microsoft, Facebook, Twitter, Google
OAuth 2.0 to consume your data
24. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Authentication
o Table level authorization for CRUD operations
Everyone: 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
o Your application can add whatever other authorization
is needed.
25. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Authentication
o Server script to match against your table (role-based
access, specific user, etc.)
28. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Push Notification - Logic
o Register your push notification on mobile service
o WNS client secret and package SID for Windows
o API KEY for Android
o Certificate for IOS
o Ability to send Tile, Toast, Badge, and Raw notifications.
o push logic
o Node.js module to create push notifications
33. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
Get Started
34. Agenda
Antimo Musone antimo.musone@avanade.com/@fifthelementproject.com
avanade – iit
http://www.windowsazure.com
o Services -> 750 ore al mese di istanze di calcolo piccole
o Web -> 10 siti Web
o Mobile Service ->10 servizi mobili
o RDBS ->1 database SQL
o Report SQL ->100 ore al mese
o Storage -> 70 GB con 50.000.000 transazioni di archiviazione
o Trasferimenti di dati ->senza limiti in ingresso e 25 GB in uscita
o Multimedial Services -> 50 GB (input e output combinati)
o CDN -> 20 GB in uscita con 500.000 transazioni
o Cache -> 128 MB
X-ZUMO-APPLICATION – The application key of the mobile service. X-ZUMO-AUTH - T he service-generated authentication token for an authenticated user. You must specify a token for an authenticated user when required to access the table operation. X-ZUMO-MASTER - The service master key. OData does this by applying and building upon Web technologies such as HTTP , Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Allowing developers to build one code base using one language – that is the nirvana for developers. Node’s evented I/O model freed us from worrying about locking and concurrency issues that are common with multithreaded async I/O. Every connection will execute by the callback not by thread . Each connection is only a small heap allocation.
An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. If you're storing protected data on your users' behalf, they shouldn't be spreading their passwords around the web to get access to it. Use OAuth to give your users access to their data while protecting their account credentials. Service use Oauth to access your data without your credentials.