building windows 8 apps with windows azure benjamin soulier windows azure mvp, cambridge technology...
TRANSCRIPT
Building Windows 8 apps with Windows AzureBenjamin SoulierWindows Azure MVP, Cambridge Technology PartnersTwitter: @bsoulierEmail: [email protected]
Agenda
Agenda
StorageAuthenticationNotifications
StorageApplications Use Data
Data Needs to be Stored
The Cloud Can Help
Why Does My App Need Data?
• Enriches and personalizes applications
• Makes applications more appealing
• Provide useful services and capabilities
• Differentiate your application from others Personalization Context
Why Cloud Storage?
Click icon to add picture• Elasticity• Scale• Cost model• Near your users• Near your cloud
applications• Personalize applications
Elasticity/Scale
SkyDrive
Choices for application developers• Windows Live SkyDrive• Windows Azure
Storage• SQL Azure Database
Click icon to add pictureClick icon to add picture
Azure Storage Storage
SQL Azure
Windows Live SkyDrive
• Simple Storage, Simple Sharing
• Store, organize, and download files, photos, and favorites
• Collaborate on documents
Windows Azure Storage
• Persistent and durable storage for both structured and unstructured data
• Asynchronous messaging
• Highly scalable• REST-based interfaces
SQL Azure Database
• Highly available and scalable cloud database service
• Managed service (no setup or management)
• Familiar Relational Database Management System (RDMS)
• High availability and fault tolerance built in
Three difference forms of cloud storage?
One storage for each useWindows Azure Storage
CDNFault-toleranceStructured, non-relational dataQueuesGeo replicationNear computeREST & Managed APIs
Windows Live SkyDrive
Using Windows & Live IDPersonal file storageSynchronize personal assets and apps across Windows devicesFree
SQL Azure Database
Relational dataAdditional services such as reporting, sync, backup/restore, export/import
Account
Container Blobs
Table Entities
Queue Messages
Windows Azure Data Storage Concepts
https://<account>.blob.core.windows.net/<container>
https://<account>.table.core.windows.net/<table>
https://<account>.queue.core.windows.net/<queue>
Windows Azure Blobs
Click icon to add pictureA highly scalable and durable file system in the cloudAn account can create many containers No limit on number of blobs in a container
Associate metadata with blobsShare your blobsPublic containers, Shared Access Signature (SAS)
Upload/Download BlobsAllows range readsConditional operations – If-Match, If-Not-Modified-Since etc.
Windows Azure CDN
• Enhance end user performance by placing copies of data closer to users
• 24 physical nodes globally
• Smooth streaming
Windows Azure Tables
Massively Scalable and Durable Structured StorageProvides flexible schema A storage account can contain many tables No limit on number of entities (aka rows) in each table
Simple REST APIFamiliar and Easy to use APIOData ProtocolWCF Data Services - .NET classes and LINQ
Windows Azure Tables - Features
Click icon to add pictureShared Key and Shared Key Lite AuthenticationContinuation Tokens for Query PaginationPrimary Key SystemPartitionKeyRowKey
Timestamp System Property
Windows Azure Queues
Highly scalable, available and provides reliable message deliveryA storage account can create any number of queuesAccess is provided via REST
Windows Azure Queue Message
Click icon to add picture64K message size limit and default expiry of 7 daysProgramming semantics – Ensures that a message can be processed at least once Get message to make the message invisibleDelete message to remove the message
Easy provisioning and deployment
Auto high-availability and fault tolerance
No need for server or VM administration
Database utility; pay as you grow
Business-ready SLAs
Enable multi-tenant solutions
World-wide presence
Build cloud-based database solutions on relational model
Leverage existing skills through known developer and management tools
SQL Azure Database
Managed Service
Scale on Demand
Innovate Faster
SQL Azure Database
Was based on SQL Server 2008 engineUse same tools and data access frameworksSix global datacentersHigh Availability & RedundancyReads are completed at the primaryWrites are replicated to a quorum of secondaries
Replica 1
Replica 2
Replica 3
DB
Single LogicalDatabase
Multiple PhysicalReplicas
Single Primar
y
MultipleSecondaries
Storage Secrets
Windows AzureStorage nameStorage key
SQL AzureUsernamePassword
Once your share your secret, it’s no longer secret
How do we keep secrets secret?
Proxy the requests
1. Client sends data to web role
2. Web role sends data to storage
Web
Role
(1)
(2)
What are the options?
Choices Direct Proxy Other
Blob (private) x x x (SAS)
Blob (public) x x (write) x (read-only)
Table x x
Queue x x
Database x
Using Shared Access Signatures
Client makes request of Web Role for SASWeb Role sends client SASClient makes requestClient gets response
WebRole
(1)
(2)
(3) (4)
SQL Azure
Client sends request to proxyProxy makes SQL call against SQL AzureSQL Azure returns a responseProxy returns response to device
WebRole
(1)
(2)
(3)
(4)
Authentication
Authentication hell
Click icon to add pictureToday’s AuthenticationMultiple auth credentialsMultiple online or onsite identity providersMulti-device problem – have to log multiple times on each
Windows 8 PasswordvaultKeeps identities used to authenticate with one appNo need to re-auth from one machine to anotherWorks with Windows Azure Access Control ServiceCan leverage your own company credentials with ADFS
Access Control Service
Azure based ServiceClaims basedIdentity Federation (Live ID, Google, ADFS v2, Facebook)Claim mapping engine to
Windows 8 Auth Magic
Passwordvault based on Live ServicesKeeps credential tokens (not user/pwd) to authenticate back with the appDoesn’t connect back with IP
PasswordVault Example
Getting Ips list:var request = new XMLHttpRequest(); request.open("GET", IPSFeedURL("https://ACSNAMESPACE.accesscontrol.windows.net"), false); request.send(null); var jsonString = request.responseText; var jsonlist = ParseIPList(jsonString);
Storing credentials:var cred = new Windows.Security.Credentials.PasswordCredential( url, username, token); vault.add(cred);
Getting credentials:var cred = vault.retrieve(url, username);
Click icon to add pictureClick icon to add picture
Click icon to add pictureClick icon to add picture
Notifications
Windows 8 Tiles
Tiles are the image of your app in MetroNotifications are using WNS (Windows Push Notification Service)Plenty of ways to set notificatrions onf your tiles
Push Notification Overview
1. Request Channel URI
2. Register with your Cloud Service
3. Authenticate & Push Notification
Windows 8
NotificationClient
Platform
Metro Style App
Cloud Service
Windows Push Notification Service
1
2
3
3
Push Notification OverviewWhat a service needs to support
How do I do that with Windows Azure?1. Request
Channel URI
2. Register with your Cloud Service
3. Authenticate & Push Notification
Windows 8
NotificationClient
Platform
Metro Style App
Windows Push Notification Service
1
2
3
3
Building a Cloud Service with Window Azure
• Windows Azure Compute• Web Role
• Full IIS support • WCF REST and
ASP.NET MVC
• Windows Azure Storage• Table Storage• Blob Storage
Cloud Service• Secure, web based API for
channel URI registration.
• Persistent storage of channel URI.
• Storage for tile and toast images.
Live Tiles and Authentication
Demo
Windows Azure Toolkit for Windows AzureAvailable on CodeplexHelps Building great Cloud Applications along with Windows 8Gives samples for building up Notification and Identity driven apps
Recap
Click icon to add pictureClick icon to add picture
Click icon to add picture
We saw today:• How to persist your app
data• How to differentiate data
storage options• How to push notifications to
you app• How to deal with profile
based replicated auth
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.