azure mobile services per windows phone e smartphones
DESCRIPTION
Discover how to easily create services that can improve your app experience, without regarding it is iOS, Android, or, obviously, Windows Phone....TRANSCRIPT
![Page 1: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/1.jpg)
Azure Mobile Services per Windows Phone e Smartphones
Edizione AppDaysFiera del Radioamatore/2014Marco Parenzan
![Page 2: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/2.jpg)
Marco Parenzan
Formazione & Divulgazione con 1nn0va
Ricerca e Innovazione con Servizi Cgn www.slideshare.net/marco.parenzan
marco [dot] parenzan [at] libero/live [dot] it
www.innovazionefvg.net
Developer e Architect in .NET e Web
Cloud Developer
![Page 3: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/3.jpg)
Lo scenario Mobile/Smartphone/Apps
![Page 4: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/4.jpg)
Mobile (oggi)…
…domani ci saranno tanti nomi: Devices
Intelligente Devices
Internet of Things
App è il modello delle applicazioni che provengono da uno «shop» Tipico per questo tipo di dispositivi
Anche nei PC (es. Windows 8) ora si chiamano App
![Page 5: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/5.jpg)
App=Client+Services
Quando parliamo di app, pensiamo subito allo smartphone e alla «grafica»
Una app non funziona mai da sola
Parliamo di applicazioni «connesse» Il valore dello smartphone è essere «online»
Sei online perché comunichiamo con dei servizi Identità (Facebook, live.it, gmail.com, linkedin, …)
Email (Live, Gmail, …)
Storage drives (OneDrive, GoogleDrive, DropBox, ….)
…
Se tutti percepiamo come scrivere una app, come scriviamo un servizio?
![Page 6: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/6.jpg)
Servizi per le App
I servizi per le app sono composti da due parti fondamentali Il Codice
L’infrastruttura
Il codice è la parte «che fa il lavoro» Lo scriviamo in qualche linguaggio (Javascript+HTML, C# e XAML, Java, PHP, ….)
L’infrastruttura dà gli «attributi» al servizio Qualità
Disponibilità
Funzionalità
![Page 7: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/7.jpg)
Introduzione al Cloud Computing
e Microsoft Azure
![Page 8: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/8.jpg)
Cos’è il Cloud Computing
L’approccio moderno alla implementazione di servizi per le App
![Page 9: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/9.jpg)
Cos’è il Cloud Computing
An approach to computing that’s about internet scale and connecting to a variety of devices and endpoints
![Page 10: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/10.jpg)
Cos’è il Cloud Computing
Time
Dem
an
d Cloud Provisioning
OverprovisionedUnderprovisioned
On-demand, scalable, multi-tenant, self-service compute and storage resources
![Page 11: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/11.jpg)
Windows Azure
Comprehensive set of services that enable you to quickly build, deploy and manage applications across a global network of Microsoft-managed datacenters
![Page 12: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/12.jpg)
Global Footprint
![Page 13: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/13.jpg)
Pay only for what you use
![Page 14: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/14.jpg)
Windows Azure Scenarios
Ideal for Applications Needing:
Scalability
Availability
Fault Tolerance
Common Application Uses:
Web Sites
Compute Intensive apps
Device Applications
Web APIs
Social Games
![Page 15: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/15.jpg)
Types of “cloud” offerings
Software-as-a-Service
consume
SaaSPlatform-as-a-Service
build
PaaSInfrastructure-as-a-
Service
host
IaaS
![Page 16: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/16.jpg)
PaaS for the Modern Web
Paas is secureEnterprise Grade Availability with support for SSL and AD
PaaS is flexibleWeb hosting your way with choice of language, framework, database, and platform
PaaS is scalableScale out or up in seconds on a Load Balanced, Always up to date, Global Infrastructure
![Page 17: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/17.jpg)
web sites virtual machines mobile servicescloud services
The modern offering (2013+)
![Page 18: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/18.jpg)
On-Premises
Models for Building and Running Apps
Virtualization
O/S
Hardware
Native Code
Custom Software
Network
Data
Applications
Firewall
Web Sites
Applications
Data
Cloud Services
Native Code
Startup Tasks
Applications
Firewall Rules
Data
Virtual Network
Virtual Machines
Native Code
Custom Software
Virtual Network
Data
Applications
Firewall Rules
O/S
Mobile ServicesApplications
Data
Auth
Notifications
![Page 19: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/19.jpg)
Go Live
Rapid deployment for quick iteration
Integrated source control with Team Foundation Server (TFS) and Git
Built-in monitoring of perf and usage data
Quick access to request logs, failed requests diagnostics and diagnostics
![Page 20: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/20.jpg)
Enterprise grade
High availability with SLA on reserve instances.
A global network of data centers.
Guaranteed SLA and 24/7 support.
Load balanced Up to date Easily scale Economical
![Page 21: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/21.jpg)
Scalability
Scaling up and scaling out
0 1 2 3 4 5 6 7 8
Instances
Throughput
Instance Capacity
Quota
![Page 22: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/22.jpg)
Scaling
Free
Shared
Standard
Multi-tenant. Daily quotas
Multi-tenant. Daily quotas
Dedicated VMs. No quotas
![Page 23: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/23.jpg)
Open and flexible
Choice of languages.
Choice of databases.
Web app gallery. Zero lock in.
![Page 24: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/24.jpg)
Choice of language
Node.js: 0.6.17, 0.6.20, 0.8.2
PHP: 5.3PHP: 5.4
ASP.NETNET: 3.5, 4.5, 4.5.1 Python: 2.7
Bring a stack: FastCGI basedRubyJava
![Page 25: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/25.jpg)
Azure Mobile Services
![Page 26: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/26.jpg)
Mobile Services
Easily build cloud back-ends
Data, identity, push notifications, and scheduled scripts
Windows Store, Windows Phone, iOS, and Android
![Page 27: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/27.jpg)
Mobile Services
Cdn
Services for Cloud and Mobile Applications
Caching
Media
Big data
Analytics
Web Sites
Integration
Service bus
SQL database noSQL DB
Blob storage
Cloud services
Virtual Machines
Identity
Messaging
Networking
Traffic
Storage
![Page 28: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/28.jpg)
What are Mobile Services?
Data
Notifications
Auth
Server Scripts + Custom API
Scheduler
Logging & Diag
Scale
![Page 29: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/29.jpg)
Structured Storage
Powered by SQL Database
Same DB – Multiple Mobile Services AppX.Todoitem
AppY.Todoitem
Data management in Windows Azure Portal
SQL Portal, SQL Management Studio
REST API
CLI Tools
![Page 30: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/30.jpg)
The REST API
Action HTTP Verb URL Suffix
Create POST /TodoItem
Read GET /TodoItem?$filter=id%3D42
Update PATCH /TodoItem/id
Delete DELETE /TodoItem/id
Data Operations and their REST Equivalents
Base REST API Endpoint URL
https://Mobileservice.azure-mobile.net/tables/*
![Page 31: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/31.jpg)
JSON to SQL Type Mappings
JSON Value T-SQL Type
Numeric values (integer, decimal, floating point)
Float(53)
Boolean Bit
DateTime DateTimeOffset(3)
String Nvarchar(max)
![Page 32: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/32.jpg)
Auth*
Authenticate against Microsoft Account, Twitter, Facebook, Google
Table level permissions for each CRUD operation Everyone
Anyone with the Application Key
Only Authenticated Users
Only Scripts and Admins
More granular control with server side scripts user.level: {admin, authenticated, anonymous}
user.userId: id or undefined if not authenticated
![Page 33: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/33.jpg)
The User object
User.level Anonymous
Authenticated
Admin
User.userId Provider:id or undefined
User.getIdentities() UserId
Provider Access Token / Secret
![Page 34: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/34.jpg)
Raggiungere l’utente: push notifications
![Page 35: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/35.jpg)
Push Notifications
Integrates with WNS to provide Toast, Tile, Badge and Raw notifications
Portal captures your WNS client secret and package SID
push.wns.* provides: clean easy object model to compose notifications
Performs auth against WNS for you
![Page 36: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/36.jpg)
How Push Notifications Work
Retrieve device handle
PNS(APNS, WNS, GCM)
Store handle in app back-end Send notification to handle
Device notified (even when app is inactive)
![Page 37: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/37.jpg)
Server Side Scripts
Customizing logic on the server
Node.js scripts
Passes through to SQL by default
Intercept CRUD requests to tables
Fully customizable logic flow
![Page 38: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/38.jpg)
Node Modules
Extensibility through numerous included modules
request
console
push.*
mssql
statusCodes azure
sendgrid
pusher
twilio
![Page 39: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/39.jpg)
How Service Bus Notification Hub Works
Retrieve device handle
PNS
Registration with tagsSend notification to handle
Push notification
![Page 40: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/40.jpg)
Azure Mobile Services:other goodies
![Page 41: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/41.jpg)
More on script options: Custom API
Non-table based scripts
Accessible from Get
Post
Put
Patch
Delete
Same permissions as tables
![Page 42: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/42.jpg)
Storage: What are our options?
Benefits: Non-relational structured storage
Massive scale-out
Tables Storage
Benefits: Big filesBlobs
Benefits: Persistent Async Messaging
Enqueue, Dequeue
Queues
Benefits: Relational database
Highly available
Managed for you as a service
SQL Database
![Page 43: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/43.jpg)
Script Source Control
Handled through GIT repo
• Access to table, scheduler, custom API, shared scripts, and permissions
Shared Scripts
• Make scripts accessible from other scripts
• Just like creating Node.js modules NPM
• Ability to use ‘npm install module’ to download NPM modules
![Page 44: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/44.jpg)
Mobile Services Tiers
Free Standard Premium
Usage Restrictions
Up to 10 services,Up to 500 Active
Devices*
N/A N/A
API Calls 500K (per subscription)
1.5M(per unit)
15M(per unit)
Scale N/A Up to 6 Standard units
Up to 10 Enterprise units
Scheduled Jobs
Limited Included Included
SQL Database (required)
20MB Included, Standard rates apply for more capacity
20MB Included, Standard rates apply
for more capacity
20MB Included, Standard rates apply for more capacity
![Page 45: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/45.jpg)
Conclusions
![Page 46: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/46.jpg)
Conclusions
il Cloud Computing è la piattaforma di riferimento per complementare la parte «client» di una App
Microsoft Azure è la piattaforma Cloud di riferimento per ricchezza di servizi e molteplicità di modelli per lo sviluppo
Azure Mobile Services sono una piattaforma che semplifica l’acceso al Cloud per chiunque voglia scrivere app… …avendo subito servizi di classe enterprise
…ma potrà scalare a modelli e livelli di servizio ancora più alti
![Page 47: Azure Mobile Services per Windows Phone e smartphones](https://reader034.vdocument.in/reader034/viewer/2022051817/5482172eb4af9f0b518b4777/html5/thumbnails/47.jpg)
Grazie!
www.slideshare.net/marco.parenzan
marco [dot] parenzan [at] libero/live [dot] it
www.innovazionefvg.net
@marco_parenzan
it.linkedin.com/in/marcoparenzan
www.facebook.com/parenzan.marco
www.marcoparenzan.it
www.slideshare.net/marco.parenzan
github.com/marcoparenzan
www.scoop.it/u/marco-parenzan
Q&A