windows azure mobile services - kolkata - 28 june 2015
TRANSCRIPT
![Page 1: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/1.jpg)
Azure Mobile Services- a backend for your mobile app in minutes
Kunal Chowdhury
![Page 2: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/2.jpg)
About Me
Kunal Chowdhurywww.kunal-chowdhury.com
Microsoft MVP (Windows Platform Development)Telerik Developer Expert
twitter.com/kunal2383
facebook.com/blog.kunal
![Page 3: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/3.jpg)
Getting Started- quick introduction to the platform
![Page 4: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/4.jpg)
why is mobile so important?
![Page 5: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/5.jpg)
Enterprises want to manage internal mobile apps and consumer facing event or product-specific mobile apps from the same portal as core LOB apps.
Small Businesses require solutions that accelerate development time and decrease development costs.
Developers shouldn’t have to constantly reinvent the wheel and reproduce common backend functionality.
Consumers expect a continuous experience across all devices.
App DevelopmentChallenges
![Page 6: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/6.jpg)
Windows Azure Mobile Services addresses each of those challenges.
![Page 7: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/7.jpg)
Windows Azure Mobile
Services accelerates connected
client application development by
streamlining common backend tasks
like structuring storage,
authenticating users, and sending
push notifications.
![Page 8: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/8.jpg)
What is Windows Azure Mobile Services?
Data
Notifications
Auth
Server Logic
Scale
Logging
Diagnostics
![Page 9: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/9.jpg)
Key Scenarios
Make your app engaging and dynamicPush notifications and Live Tiles is the premier way to engage your customers. Make your app engaging and dynamic using Mobile Services Push.
Rapid DevelopmentTime is money. Get your app up and running sooner when you use Mobile Services to configure a secure backend in less than five minutes.
Make your app socialWhether your customers use Google, Facebook, Twitter or Microsoft Account, no matter what devices they run your app on, with Mobile Services you can make your app social and personable fast.
![Page 10: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/10.jpg)
3
Connected Apps
Windows StoreiOSAndroid
Windows Phone 8iOSAndroidHTML 5/JS
SDKs
Data in the Cloud
SQL Table Blob
User Authentication
Facebook Twitter Microsoft Google
Push Notifications
WNS & APNS GCMMPNS
Server-Side Scripts
&
Scheduler
Basic Features
![Page 11: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/11.jpg)
Supported Platforms
iOSWindows 8 Windows Phone 8 AndroidHTML5 & Javascript
![Page 12: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/12.jpg)
SQL Database & Tables
Windows Azure Mobile Services Architecture
Nod
e.js
Windows Azure Mobile Service
Azure SQL Database
Client SDK & API
Client App
Data Services (CRUD) Authentication Services Push Notifications
Windows 8 Windows Phone Apple iOS Android HTML5/JS
Windows 8 Windows Phone Apple iOS Android HTML5/JS REST/HTTP
REST API
Monitoring and Logging 3rd Party Services
Server Side Scripts
![Page 13: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/13.jpg)
Nod
e.js
SQL Database & Tables
DATA STORAGE SERVICES
Windows Azure Mobile Service
Azure SQL Database
Client SDK & API
Client App
Data Services (CRUD) Authentication Services Push Notifications
Windows 8 Windows Phone Apple iOS Android HTML5/JS
Windows 8 Windows Phone Apple iOS Android HTML5/JS REST/HTTP
REST API
Monitoring and Logging 3rd Party Services
Server Side Scripts
![Page 14: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/14.jpg)
Client SDK Simplifies This
Mobile Services Data WORKFLOW
Insert script
Update script
Delete script
Read script
Node.JS Scripts
Some JSON Object{ Timestamp=“…”, Location=“…” }
REST
ove
r HTT
P
![Page 15: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/15.jpg)
Dynamic Schema
Design First
Code First (Default)
![Page 16: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/16.jpg)
Push Notifications
Insert, Update, Delete, Read on a Table
Automatic or Manual Server ScriptAn Event
Script Runs in the Azure Mobile Service
WindowsPhone 8
MPNS
iOS
APNS
Android
GCM
Windows 8
WNS
![Page 17: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/17.jpg)
Push Notifications1. Request Channel URI2. Register with your Cloud Service3. Authenticate and Push Notification
![Page 18: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/18.jpg)
Push Notifications- Integrates with WNS (and MPNS, APNS, or GCM)
- Toast, Tile, Badge and Raw notifications
- Portal captures WNS client secret and package SID
- push.wns* provides:- Clean object model to compose notifications- Auth against WNS for you
![Page 19: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/19.jpg)
Authentication- Out of the box support for Microsoft Account, Facebook,
Twitter and Google
- Table level permissions for each CRUD operation Everyone Anyone with Application Key Only Authenticated users Only Scripts and Admins
- More granular control with server-side scriptsid or undefined if not authenticated
![Page 20: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/20.jpg)
Authentication• To enable authentication, you must first
register your app with one or more of these identity providers and then configure your mobile service.
• You must also add authentication code to your app.
• When a user login is authenticated by Mobile Services, the value of the userId property on the user object passed to server scripts is set to a value that uniquely identifies a user. This value can then be used to authorize access to data.
![Page 21: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/21.jpg)
Azure Management Portal- quick introduction to the platform
![Page 22: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/22.jpg)
Dashboard• Quick glance
• Displays relevant mobile service information, including the service URL, status, location, database and subscription
• Usage Timeline:
• Displays a scalable chart of CPU time, API calls and data reads over a specific period of time.
• Usage Overview:
• Displays an overview of the total compute time and storage used by this mobile service
• Manage Keys
• Manage Keys
• Delete
• Delete the Mobile Service
![Page 23: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/23.jpg)
Data• In Windows Azure Mobile Services, data is
stored in tables, which are maintained in the Windows Azure SQL Database that is associated with your mobile service.
• Click the Create button to add a new table to your mobile service.
• By default, you don’t need to predefine the schema of tables in your database.
• Mobile Services automatically add columns to a table based on the data you insert. To change this dynamic schema behavior, use the Dynamic Schema setting on the Configure tab.
• To browse data, manage permissions and indexes on tables, or add server scripts, click on a table in the list.
• To delete a table, click to select a table row, and then click Delete.
![Page 24: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/24.jpg)
Browse• The Browse tab lets you browse data rows
in a selected table.
• Click the forward and back arrows to navigate through multiple pages of data.
• Click on table names in the left navigation bar to switch between tables.
• Click on the large left arrow to go back to the Data tab.
![Page 25: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/25.jpg)
Script• Mobile Services enables you to register
JavaScript code to be executed by the service when an insert, update, delete, or read operation occurs against a specific table.
• For each table there are 4 CRUD operations (insert, read, update, del)
• These scripts provide the ability to inject business logic into table operation, stop an operation from taking place, change or enrich values supplied to the operation or change the results.
• For authenticated clients, you can also perform user-specific authorizations based on the userId value of the supplied user object.
![Page 26: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/26.jpg)
Columns• To delete columns, click the column and then click
Delete.
• To add additional columns to the table, simply send an insert request including the new properties from your app with dynamic schema enabled.
• Once a column is created, its data type cannot be changed by Mobile Services.
• Insert or update operations fail when the type of a property in the JSON object cannot be converted to the type of the equivalent column in the table.
• You can improve the performance of queries by defining an index on the table.
• To add a column to the index, select the column and click Set as Index.
![Page 27: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/27.jpg)
Permissions• Mobile Services enables you to set the following permissions
on table operations:
• Everyone: request for the operation against the table is accepted. This option leaves your data wide-open for everyone to access.
• Anybody with the Application Key: The application key is required to perform the operation. The application key is distributed with the application. Note: Because this key is not securely distributed, it cannot be considered a security token. To secure access to your mobile service data, you must instead authenticate users before accessing.
• Only Authenticated Users: Only authenticated users are permitted to perform the operation. Scripts can be used to further restrict access to tables based on an authenticated user.
• Only Scripts and Admins: The operation requires the service master key, which limits the operation only to registered scripts or to administrator accounts
![Page 28: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/28.jpg)
Push• Mobile Services can send push notifications to your apps.
• The way that you configure and send push notifications depends on your app.
• You can send push notifications to the following applications:
• Windows Store app by using the Windows Push Notification Service (WNS). To send push notifications to your app, you must configure your mobile service to work with WNS.
• iPhone and iPad apps by using the Apple Push Notification Service (APNS). To send push notifications to your app, you must configure your mobile service to work with APNS.
• Android: You can send push notifications to Android apps by using the Google Cloud Messaging (GCM) service. To send push notifications to your app, you must configure your mobile service to work with GCM.
• Windows Phone 8 app by using the Microsoft Push Notification Service (MPNS). Mobile Services does not require you to register your Windows Phone 8 app to send push notifications.
![Page 29: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/29.jpg)
Identity• Mobile Services integrates with the following
identity providers to make it easy to authenticate users from your app: • Microsoft Account • Facebook login • Twitter login • Google login
• To enable authentication, you must first register your app with one or more of these identity providers and then configure your mobile service.
• You must also add authentication code to your app.
• When a user login is authenticated by Mobile Services, the value of the userId property on the user object passed to server scripts is set to a value that uniquely identifies a user. This value can then be used to authorize access to data.
![Page 30: Windows Azure mobile services - Kolkata - 28 June 2015](https://reader033.vdocuments.us/reader033/viewer/2022042701/55c581c3bb61eb09398b4583/html5/thumbnails/30.jpg)
My blog: www.kunal-chowdhury.com