Download - Brewing Beer with Windows Azure - ASPConf
![Page 1: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/1.jpg)
Brewing Beerwith Windows Azure
Maarten Balliauw@maartenballiauw
http://jabbr.net/#/rooms/aspconf-room4
![Page 2: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/2.jpg)
Who am I?
• Maarten Balliauw• www.realdolmen.com • Focus on web– ASP.NET MVC, Windows Azure, SignalR, ...– MVP Windows Azure & ASPInsider
• http://blog.maartenballiauw.be • @maartenballiauw
![Page 3: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/3.jpg)
Antwerp, Belgium
![Page 4: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/4.jpg)
Who am I?
• Maarten Balliauw• www.realdolmen.com • Focus on web– ASP.NET MVC, Windows Azure, SignalR, ...– MVP Windows Azure & ASPInsider
• http://blog.maartenballiauw.be • @maartenballiauw
![Page 5: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/5.jpg)
Shameless commercial plug
• Pro NuGet:http://amzn.to/pronuget
• MyGet - NuGet-as-a-Service: http://www.myget.org
![Page 6: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/6.jpg)
Agenda
• Brewing beer• BrewBuddy• Windows Azure Websites• Service Bus & Access Control Service
(ACS)• We need an API• Q&A
http://jabbr.net/#/rooms/aspconf-room4
![Page 7: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/7.jpg)
Brewing BeerTurn water into beer
![Page 8: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/8.jpg)
How it started…
![Page 9: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/9.jpg)
How it started…
• MVP Summit 2011–Wade Wegner talks about his
homebrewing hobby
• MVP Summit 2012–Wade Wegner talks about his
homebrewing hobby
• Convinced!
![Page 10: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/10.jpg)
The process
• Get your kegs clean• Add & boil ingredients• Pour in keg• Add yeast• Rinse
![Page 11: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/11.jpg)
The process
Wait for fermentation to complete
![Page 12: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/12.jpg)
The process
• Pour into another keg• Rinse• Wait another week• Bottling time!
![Page 13: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/13.jpg)
Difficult part…
Wait at least 6 weeks for it to age
![Page 14: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/14.jpg)
Maarten…
What does this haveto do with Windows Azure?
![Page 15: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/15.jpg)
www.BrewBuddy.netAzurifying the home brewer
![Page 16: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/16.jpg)
BrewBuddy
• View public recipes• Manage your own recipes• Manage your own brews• Monitor brew fermentation
![Page 17: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/17.jpg)
demoSocial brewing at a glance
BrewBuddy
![Page 18: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/18.jpg)
ArchitecturePublic websiteWindows Azure Web Sites
DatabaseSQL Azure database
Sensor data processingWindows Azure Worker Role
Sensor dataService Bus topic
SensorWhatever…
![Page 19: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/19.jpg)
Windows Azure Web Sites
Scale-fast has just become more interesting
![Page 20: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/20.jpg)
Windows Azure Web Sites
Build with ASP.NET, Node.js or PHP Deploy in seconds with FTP, Git or
TFS Start for free, scale up as your
traffic grows
![Page 21: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/21.jpg)
1SHARED INSTANCES
:-)
shared
Windows Azure Web Sites
![Page 22: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/22.jpg)
2SHARED INSTANCES
:-)
:-)
shared
Windows Azure Web Sites
![Page 23: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/23.jpg)
SHARED INSTANCES
:-)
1RESERVED INSTANCE
:-):-)
0reserved
Windows Azure Web Sites
![Page 24: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/24.jpg)
2RESERVED INSTANCE
:-)
RESERVED INSTANCE
:-)
reserved
Windows Azure Web Sites
![Page 25: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/25.jpg)
2RESERVED INSTANCE
:-)
RESERVED INSTANCE
:-):-)
:-) :-)
:-)
:-) :-)
reserved
Windows Azure Web Sites
![Page 26: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/26.jpg)
A perfect ramp-up!
• Start small–Web Sites are cheap–Scale to 3 reserved instances
• Grow big!–Hosted Service – PaaS–Scale at will
![Page 27: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/27.jpg)
demoCreating a new web site in seconds
Windows Azure Web Sites
![Page 28: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/28.jpg)
Service Bus& Access Control Service
Connecting sensors
![Page 29: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/29.jpg)
Windows Azure Service Bus
• 2 features–Relay–Queues, Topics, Subscriptions
![Page 30: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/30.jpg)
Windows Azure Service Bus Relay
Client Service
relay
![Page 31: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/31.jpg)
Topics and subscriptions
SensorBackendWorker
![Page 32: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/32.jpg)
Characteristics
• Workers can scale independently• Workers can fail independently• Sensors connect to service bus
directly–No layer in between–Cheaper
![Page 33: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/33.jpg)
What about authN / authZ?
• Access Control Service to the rescue!
• SB authenticates clients over ACS
• ACS provides “Send” claim to sensor
• Claims can be granted/revoked easily
![Page 34: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/34.jpg)
demoClaims for authZ on Service Bus
Access Control Service
![Page 35: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/35.jpg)
ArchitecturePublic websiteWindows Azure Web Sites
DatabaseSQL Azure database
Sensor data processingWindows Azure Worker Role
Sensor managementAccess Control Service
Sensor dataService Bus topic
SensorWhatever…
![Page 36: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/36.jpg)
How do you link a sensor?
• Every sensor has its sensor ID• Add it as an identity to ACS• Grant a “Send” claim
![Page 37: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/37.jpg)
demoRegistering a sensor with Access Control Service
Linking a sensor to a brew
![Page 38: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/38.jpg)
We need an API<french>Make everyone API!</french>
![Page 39: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/39.jpg)
What is an API?
• Software-to-Software interface• Contract between software and
developers– Functionalities, constraints (technical / legal)
Programming instructions and standards
• Open services to other software developers (public or private)
![Page 40: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/40.jpg)
Do we need one?
• Reach to scale• Smartphone generation• BYOD with 3 screens: phone, tablet and
computer• Flexibility in providing content• You have data to share• Integration
![Page 41: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/41.jpg)
Build Richer AppsReach More Clients
![Page 42: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/42.jpg)
ASP.NET Web API• Part of ASP.NET MVC 4• Framework to build HTTP Services (REST)• Solid features
– Modern HTTP programming model– Content negotiation (e.g. Xml, json, ...)– Query composition (OData query support)– Model binding and validation (conversion to .NET objects)– Routes– Filters (e.g. Validation, exception handling, ...)– And more!
![Page 43: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/43.jpg)
demoLet’s craft a quick API
ASP.NET Web API
![Page 44: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/44.jpg)
What about authN / authZ?
• API access through OAuth2• Access Control Service to the rescue!• Client authorized in BrewBuddy.net• Access/refresh tokens through ACS
![Page 45: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/45.jpg)
What about authN / authZ?
Access Control ServiceAccess/Refresh Token
API Consumerclient_id and client_secret
BrewBuddy.netInitial authorization (yes/no)API implementation
authorize
register delegationaccess/refresh token
access API
![Page 46: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/46.jpg)
demoOAuth2 delegation
Access Control Service for API’s
Install-Package WindowsAzure.Acs.Oauth2 -IncludePrerelease
![Page 47: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/47.jpg)
Takeaways
![Page 48: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/48.jpg)
Keep in mind…
• Web Sites start cheap / scale fast• Combine/grow at will (IaaS, PaaS,
SaaS)• Service bus for asynchrony and scale• Access Control for devices• Web API & Access Control
![Page 49: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/49.jpg)
Related sessionsToday• 3:30-5pm UTC
– Test-First and Functional-First with Web API (room 3)
• 8-9:30pm UTC– Ask the Experts (SignalR, MVC, Web API) (live video)
• 9:30-11pm UTC– Azure SDK (room 1)– Introduction to the ASP.NET Web API (room 2)
Tomorrow• 3:30-5pm UTC
– From Zero to Hero: Windows Azure Web Sites and TFS Preview (room 3)– Advanced ASP.NET Web API (room 5)
• 9:30-11pm UTC– The Lightweight Approach to Building Web Based APIs with .Net
![Page 50: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/50.jpg)
Q&A
![Page 51: Brewing Beer with Windows Azure - ASPConf](https://reader035.vdocuments.net/reader035/viewer/2022062418/555ab741d8b42ad0538b549f/html5/thumbnails/51.jpg)
Thanks!Brewing Beer with Windows Azure
@maartenballiauw
http://bit.ly/Mrx0tH