azure mobile services : service enablement at its best

30
Learn. Connect. Explore. Learn. Connect. Explore.

Upload: ruhani-arora

Post on 13-Jan-2017

216 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Azure Mobile Services : Service Enablement at its best

Learn. Connect. Explore.

Learn. Connect. Explore.

Page 2: Azure Mobile Services : Service Enablement at its best

Building Microsoft Azure Mobile Services with Visual StudioPoonam Sampat Technical Evangelist @sampatpoonam

Ruhani Arora Technical Evangelist@infinitydlimit

Page 3: Azure Mobile Services : Service Enablement at its best

I am familiar with Mobile Services

Page 4: Azure Mobile Services : Service Enablement at its best

AgendaOverview of Mobile Services.NET Mobile Services

Build a Win Store app with .NET Mobile Services in Visual StudioStoring and accessing data with SQLAuthentication using AADStoring files in blob storageOffline SyncPush Notifications using Notification HubsScaling and Diagnostic

Page 5: Azure Mobile Services : Service Enablement at its best

Overview

Page 6: Azure Mobile Services : Service Enablement at its best

Mobile Backend as a Service

Push Notifications

Data Storage

User AuthenticationNode.js Express

.NET Web API

SQL Table Storage Blob

Storage

WNS & MPNS

APNS GCM

Mongo DB

Notification Hubs

Source Control

Facebook

Twitter Microsoft Google

Azure Active

Directory

Windows Store iOSAndroid XamarinPhonegapSenchaWindows PhoneiOSAndroidHTML 5/JS

SDKs

REST

API

Hybrid Connections

Offline Sync

Page 7: Azure Mobile Services : Service Enablement at its best

Enable .NET developers to easily add a backend to their apps, use their preferred frameworks, tools, and processes

Page 8: Azure Mobile Services : Service Enablement at its best

.NET Mobile Services

Data Based on Web APISupports various data stores:• Azure databases• Table Storage• MongoDB

Tooling• Client NuGet• Runtime available

on NuGet

Visual Studio support:• Scaffolding• IntelliSense• Local F5• In-browser test

client• Remote debugging• Publish via Web

Deploy• Source control using

TFS• View runtime logs• Send test messages• View registrations

Auth• Facebook• Twitter• Google • Microsoft Account• AAD

PushUses Notification Hubs integration for high-scale, cross-platform push

Web API for Mobile with minimal code for data, auth, and push notifications.

Page 9: Azure Mobile Services : Service Enablement at its best

Demo App – Feedback ApplicationFeedback app to store feedback of sessions.Attendees must log in with their AD credentialsAttendees are sent notifications for candidates in their disciplineAttendees can upload experiences as documents to blob storageWhat if the services go down how can the application still work.

Page 10: Azure Mobile Services : Service Enablement at its best

Demo Storing and accessing data with SQL

Page 11: Azure Mobile Services : Service Enablement at its best

Authentication

Page 12: Azure Mobile Services : Service Enablement at its best

Azure Active Directory and Mobile Services

Extend line-of-business to mobile

Bring turn-key login experience with corporate credentials to mobile developers

Enable applications built around organizational structures

Page 13: Azure Mobile Services : Service Enablement at its best

Active Directory Authentication Library (ADAL)

Facilitates login to AAD-protected resources

Provides single sign-on to multiple enterprise resources

Available for Windows Store, iOS, and Android

Page 14: Azure Mobile Services : Service Enablement at its best

AAD and Mobile Services User logs in to

AAD and requests token

AAD returns access token

to mobile device

Client passes access token

to Mobile Service

Page 15: Azure Mobile Services : Service Enablement at its best

Demo with AAD and Mobile Services

Page 16: Azure Mobile Services : Service Enablement at its best

Blob Storage + Mobile Services

Page 17: Azure Mobile Services : Service Enablement at its best

Store files using Azure StorageStoring files in Azure StorageCost effective, scalable, and accessible from anywhere

Can’t burn secrets into your client appImagine malicious users uploading random files to your storage account

Shared Access SignatureAllows clients to read/write/update data without a storage account keyObtain a restricted token that allows you to access storage account for a short period of time

Page 18: Azure Mobile Services : Service Enablement at its best

Mobile Services and SAS to Azure Storage

Access storage

resources using SAS

token

Authenticate against MS and request SAS token

Acquire SAS token for storage

Set a limited access

policy and request SAS

token

Page 19: Azure Mobile Services : Service Enablement at its best

Storage with SASNeed to install NuGet Packages – Azure Storage

CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentials(storageAccountName, storageAccountKey));

CloudBlobContainer container = blobClient.GetContainerReference(item.containerName); await container.CreateIfNotExistsAsync();

SharedAccessBlobPolicy sasPolicy = new SharedAccessBlobPolicy() { SharedAccessStartTime = DateTime.UtcNow, SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(5), Permissions = SharedAccessBlobPermissions.Write };String sasContainerToken = container.GetSharedAccessSignature(sasPolicy);String SASUri = sasContainerToken ;

Page 20: Azure Mobile Services : Service Enablement at its best

Offline Sync

Page 21: Azure Mobile Services : Service Enablement at its best

Offline SyncLightweight and composable

Uses SQLite Backing Store, runs cross platform.

Manual push and pull and no auto sync

Conflict detection and management

Page 22: Azure Mobile Services : Service Enablement at its best

Offline Syncvar table=App.MobileService.GetSyncTable<Feedback>();

if (!App.MobileService.SyncContext.IsInitialized) { var store = new MobileServiceSQLiteStore("localsync12.db"); store.DefineTable<Feedback>(); await App.MobileService.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler()); }

Page 23: Azure Mobile Services : Service Enablement at its best

Push and Pull

await table.PullAsync();var list = await table.OrderBy(a=>a.Id).ToListAsyn();

table.Insert(new TodoItem(..));service.SyncContext.PushAsync();

Page 24: Azure Mobile Services : Service Enablement at its best

DiagnosticsLoggingScale

Page 25: Azure Mobile Services : Service Enablement at its best

SummaryWith .Net Mobile Services and Visual Studio, you can easily:

store data in the cloudauthenticate your usersinteract with Azure storage and other third party resourcesoffline syncdiagnostics and scale

Page 26: Azure Mobile Services : Service Enablement at its best

Related sessionsNotification HubsUse Xamrain to develop cross platform applications

Page 27: Azure Mobile Services : Service Enablement at its best

ResourcesLearning

Microsoft Certification & Training Resourceswww.microsoft.com/learning

msdnResources for Developers

http://microsoft.com/msdn

TechNetResources for IT Professionals

http://microsoft.com/technet

Sessions on Demandhttp://channel9.msdn.com/Events/TechEd

Page 28: Azure Mobile Services : Service Enablement at its best

Your Feedback is Important

OPTION 3: Feedback stations outside the hall

Scan the QR code to evaluate this session on your mobile device.

You can fill out evaluation of this session directly through the App

Fill out evaluation of this session and help shape future events.OPTION 1 OPTION 2

Replace this space with the actual QR Code

You’ll also be entered into a daily prize drawing!

Page 29: Azure Mobile Services : Service Enablement at its best

Follow us online

Facebookfacebook.com/MicrosoftDeveloper.India

twitter.com/msdevindiaTwitter

Twitter: @infinitydlimit@sampatpoonam

Email:[email protected] & [email protected]

Page 30: Azure Mobile Services : Service Enablement at its best

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.