azure mobile services : service enablement at its best
TRANSCRIPT
Learn. Connect. Explore.
Learn. Connect. Explore.
Building Microsoft Azure Mobile Services with Visual StudioPoonam Sampat Technical Evangelist @sampatpoonam
Ruhani Arora Technical Evangelist@infinitydlimit
I am familiar with Mobile Services
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
Overview
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
Twitter Microsoft Google
Azure Active
Directory
Windows Store iOSAndroid XamarinPhonegapSenchaWindows PhoneiOSAndroidHTML 5/JS
SDKs
REST
API
Hybrid Connections
Offline Sync
Enable .NET developers to easily add a backend to their apps, use their preferred frameworks, tools, and processes
.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.
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.
Demo Storing and accessing data with SQL
Authentication
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
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
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
Demo with AAD and Mobile Services
Blob Storage + Mobile Services
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
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
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 ;
Offline Sync
Offline SyncLightweight and composable
Uses SQLite Backing Store, runs cross platform.
Manual push and pull and no auto sync
Conflict detection and management
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()); }
Push and Pull
await table.PullAsync();var list = await table.OrderBy(a=>a.Id).ToListAsyn();
table.Insert(new TodoItem(..));service.SyncContext.PushAsync();
DiagnosticsLoggingScale
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
Related sessionsNotification HubsUse Xamrain to develop cross platform applications
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
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!
Follow us online
Facebookfacebook.com/MicrosoftDeveloper.India
twitter.com/msdevindiaTwitter
Twitter: @infinitydlimit@sampatpoonam
Email:[email protected] & [email protected]
© 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.