building connected apps – patterns, practices and mobile services by mike benkovich
DESCRIPTION
Today’s users don’t live on just a workstation or a laptop. With the proliferation of laptops, smart phones, and tablets people work from a variety of forms and clients. Building applications that can leverage a consistent view of identity, data and services will enable the workforce to be productive wherever they are. In this session we’ll explore how to design and build applications that span the various device forms and platforms using the tools and features of the Cloud that make it all possible and easy.TRANSCRIPT
![Page 2: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/2.jpg)
Session Objectives and Takeaways
What is Mobile Services?
What are the components?
Where to get the tools
How to get started
![Page 3: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/3.jpg)
Why Mobile Services?
• Apps are everywhere• Where’s the Data• Who’s using it• Minimize custom code• Speed to market
![Page 4: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/4.jpg)
Where does it run?
• Web• Windows• Android• iOS• Windows Phone• etc…
Data Svc
Data
Identity
![Page 5: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/5.jpg)
Connected Patterns
• Create a Data Store• Add services• Host it somewhere• Make it work
Data Svc
Data
Identity
![Page 6: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/6.jpg)
Data Services
![Page 7: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/7.jpg)
Scenarios
• Modern Mobile ApplicationsWindows Store, Windows Phone, iOS, Android, HTML
• Common ScenariosReduce the friction and work required by providing solutions to patterns to work with authentication, push notification, structured storage and more
• Rapid DevelopmentProvision and deploy solutions in minutes rather than days or weeks
![Page 8: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/8.jpg)
What is Mobile Services?
AuthData
Server Logic
Scale
Logging
Diagnostics
Notifications
![Page 9: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/9.jpg)
To get started…
• Windows Azure subscription• Database for storing information– SQL Azure for rapid provisioning and
deployment– Dynamic Schema
• Service configuration and scaling– Scripting on data– Identity and notifications
• SDK to enable identity and notifications
![Page 10: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/10.jpg)
Get the toolsProvision a mobile
serviceNew application
![Page 11: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/11.jpg)
Code to instantiate Mobile Services
• In Application object add code to create an instance of your Mobile Service
• Call methods to operate on the service…i.e.
public static MobileServiceClient MobileService = new MobileServiceClient( "https://demoapp123.azure-mobile.net/", "OxxAAAAbbbCCCCCddEEEfffGGGh12345" );
private void ButtonSave_Click(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Text = TodoInput.Text }; InsertTodoItem(todoItem); }
![Page 12: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/12.jpg)
Storage
• SQL Database partitioned by schema–Appx.ToDoItem–Appy.ToDoItem
• Manage data by standard SQL tools– SQL Management Studio– Portal–REST API–CLI Tools
![Page 13: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/13.jpg)
Work with SQL
• Tables created in portal• Dynamic SQL Enabled• Create poco classes and
persist as tables
![Page 14: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/14.jpg)
Working with Data
![Page 15: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/15.jpg)
Identity
• Use existing identity providers like Oauth– Microsoft, Twitter, Facebook, Google, etc.
• Authorize to work with data • Table options– Everyone– With application key– Authenticated users– Admins
![Page 16: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/16.jpg)
Add code to trigger authentication
private MobileServiceUser user; private async System.Threading.Tasks.Task Authenticate() { while (user == null) { string message; try { user = await App.MobileService .LoginAsync(MobileServiceAuthenticationProvider.Facebook); message = string.Format("You are now logged in - {0}", user.UserId); } catch (InvalidOperationException) { message = "You must log in. Login Required"; } MessageBox.Show(message); } }
![Page 17: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/17.jpg)
Working with Identity
![Page 18: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/18.jpg)
Server logic
• Scheduled jobs• Notification services• Diagnostics, logging and scale
![Page 19: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/19.jpg)
Diagnostics, Logging and Scale
• Diagnostics– API calls– CPU Time– Data Out
• Logging– console.error(…)– console.log(…)– …
Scale - ComputeScale out instance countScale up VM size
Scale - StorageScale out mobile service tenant to dedicated SQL DBScale up SQL DB
![Page 20: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/20.jpg)
Pricing during Preview
reserved mode
service level agreements
PreviewNo availability SLA*
General Availability99.9%
Shared Instance
Small instance is the only size available
Free - 10 applications with unlimited inbound data. Capped max of 165MB outbound data/day
Pay - SQL Database
Private VM - Small instance is the only size available
Free - unlimited inbound data. 165MB outbound data/day, excess charged.
Pay - SQL Database, Compute same reduced rate as Web Sites i.e 33% discount, excess outbound transfers starting at $0.12/GB
Up to 100 applications
shared mode
![Page 21: Building connected apps – Patterns, Practices and Mobile Services by Mike Benkovich](https://reader034.vdocuments.mx/reader034/viewer/2022052205/555ad9e9d8b42a62528b4c63/html5/thumbnails/21.jpg)
Summary
• Learn and understand the patterns for connected applications
• Use available tools and technologies to make it simpler
• Try Azure Mobile Services today for FREE!http://aka.ms/AzureTrialMB
• More info on my sitehttp://www.Benkotips.com