Download presentation
Presentation is loading. Please wait.
Published byRichard Percival Strickland Modified over 9 years ago
2
Building Connected Windows 8 Apps with Windows Azure Web Sites Name Title Organization
4
Basic Connectivity Media Location Push Notifications Agenda
5
Fundamentals
6
Compute: What are our Options? Virtualization O/S Hardware Native Code Custom Software Network Data Applications Firewall Applications Data Native Code Startup Tasks Applications Firewall Rules Data Virtual Network Native Code Custom Software Virtual Network Data Applications Firewall Rules O/S Applications Data Auth Notifications
7
Storage: What are our options? Benefits: Non-relational structured storage Massive scale-out Tables Storage Benefits: Big files Windows Azure Blobs Benefits: Persistent Async Messaging Enqueue, Dequeue Windows Azure Queues Benefits: Relational database Highly available Managed for you as a service SQL Database
8
Windows 8 Style UI Apps: Language Support JS/HTML C#/XAML C++ WinRT API Today HttpClient Media CameraCaptureUI Location Geolocator Notifications PushNotificationChannelManager
9
Basic Connectivity
10
Demo
11
Key Takeaway: Serialization format matters - Drivers http://localhost:33779/WcfDataService1.svc/Drivers 2010-05-24T22:12:38Z - http://localhost:33779/WcfDataService1.svc/Drivers(1) 2010-05-24T22:12:38Z - - - 1 1 Rob Tiffany - http://localhost:33779/WcfDataService1.svc/Drivers(2) 2010-05-24T22:12:38Z - - - 2 1 Loke Uei Tan - http://localhost:33779/WcfDataService1.svc/Drivers(3) 2010-05-24T22:12:38Z - - - 3 1 Dan Bouie - http://localhost:33779/WcfDataService1.svc/Drivers(4) 2010-05-24T22:12:38Z - - - 4 1 John Dietz - http://localhost:33779/WcfDataService1.svc/Drivers(5) 2010-05-24T22:12:38Z - - - 5 2 Derek Snyder - http://localhost:33779/WcfDataService1.svc/Drivers(6) 2010-05-24T22:12:38Z - - - 6 2 Steve Hegenderfer - http://localhost:33779/WcfDataService1.svc/Drivers(7) 2010-05-24T22:12:38Z - - - 7 2 Chip Vollers - http://localhost:33779/WcfDataService1.svc/Drivers(8) 2010-05-24T22:12:38Z - - - 8 2 James Pratt http://localhost:33779/WcfDataService1.svc/"http://schemas.microsoft.com/ado/2007/08/dataservices"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"http://www.w3.org/2005/Atom"http://localhost:33779/WcfDataService1.svc/Drivershttp://localhost:33779/WcfDataService1.svc/Drivers(1)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(2)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(3)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(4)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(5)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(6)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(7)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"http://localhost:33779/WcfDataService1.svc/Drivers(8)http://schemas.microsoft.com/ado/2007/08/dataservices/related/DistributionCenter"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Todays"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" The same list of 8 Customers using SOAP and a DataSet dropped us down to 3 kb but still too big for my taste. 1 1 Rob Tiffany 2 1 Loke Uei Tan 3 1 Dan Bouie 4 1 John Dietz 5 2 Derek Snyder 6 2 Steve Hegenderfer 7 2 Chip Vollers 8 2 James Pratt http://tempuri.org/"http://www.w3.org/2001/XMLSchema" OData 8.5kb <ArrayOfDriver xmlns=http://schemas.datacontract.org/2004/07/ContosoWcfService.Modelshttp://schemas.datacontract.org/2004/07/ContosoWcfService.Models xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 1 1 Rob Tiffany 1 2 Loke Uei Tan 1 3 Dan Bouie 1 4 John Dietz 2 5 Derek Snyder 2 6 Steve Hegenderfer 2 7 Chip Vollers 2 8 James Pratt http://www.w3.org/2001/XMLSchema-instance" REST-XML 1.2kb [{"DistributionCenterId":1,"DriverId":1,"FirstName":“Nick","LastName":"Harris"}, {"DistributionCenterId":1,"DriverId":2,"FirstName":“Rob","LastName":“Tiffany"}, {"DistributionCenterId":1,"DriverId":3,"FirstName":"Dan","LastName":"Bouie"}, {"DistributionCenterId":1,"DriverId":4,"FirstName":"John","LastName":"Dietz"}, {"DistributionCenterId":2,"DriverId":5,"FirstName":"Derek","LastName":"Snyder"}, {"DistributionCenterId":2,"DriverId":6,"FirstName":"Steve","LastName":“Harris"}, {"DistributionCenterId":2,"DriverId":7,"FirstName":"Chip","LastName":"Vollers"}, {"DistributionCenterId":2,"DriverId":8,"FirstName":"James","LastName":"Pratt"}] JSON 639 bytes
12
Media
13
Storage: How do we keep secrets secret? Proxy the requests Client sends data to web role Web role sends data to storage (1) (2) Web Role
14
Storage: Using Shared Access Signatures Client makes request of Web Role for SAS Web Role sends client SAS Client makes Read Request or Writes direct Client gets response (1) (3) Web Role (2) (4)
15
Demo
16
Next Steps Optimize storage calls of CreateIfNotExist Larger files upload blocks in parallel to the blob Windows Azure CDN Windows Azure Media Services Use CloudConfigurationManager to allow portability between WAWs and Cloud Services
17
Geolocation Add Point of Interest Radial Search
18
Location Basics
19
Demo
20
using System.Data.Spatial; namespace GeoLocation.Models { public class PointOfInterest { public Guid Id { get; set; } [StringLength(200)] public string Description { get; set; } public PointOfInterstType Type { get; set; } public string Url { get; set; } public DbGeography Location { get; set; } } } public class LocationContext : DbContext { public DbSet PointOfInterest { get; set; } } using (var db = new LocationContext()) { return db.PointOfInterest.Where(p => p.Location.Distance(origin) <= radiusInMeters); } EF 4.3.1 vs >= 5.0 with Spatial Data
21
Push Notifications
22
Push Notification Lifecycle Windows 8 (1) (2) (3)
23
Demo
24
Handle MessageSendResult Implement Notifications in a Worker Role There is a very rich set of notification templates available in Windows 8. Become familiar with them: Win8TileTypes – http://bit.ly/A8GuVghttp://bit.ly/A8GuVg Win8ToastTypes – http://bit.ly/MDHfJ4http://bit.ly/MDHfJ4 Win8BadgeTypes – http://bit.ly/LTf4GPhttp://bit.ly/LTf4GP Next Steps Try the NuGets http://nuget.org/packages/windows8.notifications http://nuget.org/packages/windowsazure.notifications http://nuget.org/packages/wnsrecipe
25
Application Building Blocks
26
~1.25hr using Windows 8 + Windows Azure Basic Connectivity Media Location Push Notifications Summary
27
Download the Sample Source: http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with- windows-azure/ Note: You will need to update the storage account name+key and update the SQL connection string TechEd EU recording will be made available online Sample Source
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.