windows azure mobile services - kolkata - 28 june 2015

30
Azure Mobile Services - a backend for your mobile app in minutes Kunal Chowdhury

Upload: kunal-chowdhury

Post on 08-Aug-2015

174 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Windows Azure mobile services - Kolkata - 28 June 2015

Azure Mobile Services- a backend for your mobile app in minutes

Kunal Chowdhury

Page 2: Windows Azure mobile services - Kolkata - 28 June 2015

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

Getting Started- quick introduction to the platform

Page 4: Windows Azure mobile services - Kolkata - 28 June 2015

why is mobile so important?

Page 5: Windows Azure mobile services - Kolkata - 28 June 2015

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

Windows Azure Mobile Services addresses each of those challenges.

Page 7: Windows Azure mobile services - Kolkata - 28 June 2015

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

What is Windows Azure Mobile Services?

Data

Notifications

Auth

Server Logic

Scale

Logging

Diagnostics

Page 9: Windows Azure mobile services - Kolkata - 28 June 2015

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

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

Supported Platforms

iOSWindows 8 Windows Phone 8 AndroidHTML5 & Javascript

Page 12: Windows Azure mobile services - Kolkata - 28 June 2015

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

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

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

Dynamic Schema

Design First

Code First (Default)

Page 16: Windows Azure mobile services - Kolkata - 28 June 2015

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

Push Notifications1. Request Channel URI2. Register with your Cloud Service3. Authenticate and Push Notification

Page 18: Windows Azure mobile services - Kolkata - 28 June 2015

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

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

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

Azure Management Portal- quick introduction to the platform

Page 22: Windows Azure mobile services - Kolkata - 28 June 2015

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

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

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

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

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

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

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

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

My blog: www.kunal-chowdhury.com