Brewing Beer with Windows Azure
-
Upload
maarten-balliauw -
Category
Technology
-
view
1.279 -
download
4
Transcript of Brewing Beer with Windows Azure
Brewing Beerwith Windows AzureMaarten Balliauw@maartenballiauw
#warmcrocconf
Who am I? Maarten Balliauw
Technical Evangelist, JetBrains
AZUG
Focus on web ASP.NET MVC, Windows Azure, SignalR, ... MVP Windows Azure & ASPInsider
http://blog.maartenballiauw.be
@maartenballiauw
Shameless self promotion: Pro NuGet - http://amzn.to/pronuget
Setting expectations
Agenda Brewing beer
BrewBuddy
Windows Azure Websites
Service Bus & Access Control Service (ACS)
We need an API
Q&A
Brewing BeerTurn water into beer
How it started…
How it started… MVP Summit 2011 Wade Wegner talks about his homebrewing hobby
MVP Summit 2012 Wade Wegner talks about his homebrewing hobby
Convinced!
The process
Get your kegs clean Add & boil ingredients Pour in keg Add yeast Rinse
The process
Wait for fermentation to complete
The process
Pour into another keg Rinse Wait another week Bottling time!
Difficult part…
Wait at least 6 weeks for it to age
Maarten…
What does this haveto do with Windows Azure?
BrewBuddy.netSocial brewing!
BrewBuddy View public recipes
Manage your own recipes
Manage your own brews
Monitor brew fermentation
dem
o
BrewBuddySocial brewing at a glance
ArchitecturePublic websiteWindows Azure Web Sites
DatabaseSQL Azure database
Sensor data processingWindows Azure Worker Role
Sensor dataService Bus topic
SensorWhatever…
Windows AzureWeb SitesScale-fast has just become more interesting
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
1SHARED INSTANCES
:-)
sharedWindows Azure Web Sites
2SHARED INSTANCES
:-)
:-)
sharedWindows Azure Web Sites
SHARED INSTANCES
:-)
1RESERVED INSTANCE
:-):-)
0reserved
Windows Azure Web Sites
2RESERVED INSTANCE
:-)
RESERVED INSTANCE
:-)
reserved
Windows Azure Web Sites
2RESERVED INSTANCE
:-)
RESERVED INSTANCE
:-):-)
:-) :-)
:-)
:-) :-)
reserved
Windows Azure Web Sites
A perfect ramp-up! Start small Web Sites are cheap Start free Scale from 1 shared instance… …up to 10 reserved instances!
Grow big! Hosted Service – PaaS Scale at will
dem
o
Windows AzureWeb SitesCreating a new web site in seconds
Service Bus &Access Control ServiceConnecting sensors
Windows Azure Service Bus 2 features Relay Queues, Topics, Subscriptions
Windows Azure Service Bus Relay
Client Service
relay
Topics and subscriptions
SensorBackendWorker
Characteristics Workers can scale independently
Workers can fail independently
Sensors connect to service bus directly No layer in between Cheaper
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
dem
o
Access Control ServiceClaims for authZ on Service Bus
Public websiteWindows Azure Web Sites
DatabaseSQL Azure database
Sensor data processingWindows Azure Worker Role
Sensor managementAccess Control Service
Sensor dataService Bus topic
SensorWhatever…
Architecture
How do you link a sensor? Every sensor has its sensor ID
Add it as an identity to ACS
Grant a “Send” claim
dem
o
Linking a sensorto a brewRegistering a sensor with Access Control Service
We need an API
Consuming the web 2000-2008: Desktop browser
2008-2012: Mobile browser
2008-2012: iPhone and Android apps
2010-2014: Tablets, tablets, tablets
2014-2016: Your fridge (Internet of Things)
Twitter & FacebookBy show of hands
Make everyone API(as the French say)
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)
Expose services to 3rd parties
Valuable
Flexible
Managed
Supported
Have a plan
Reach More Clients
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!
dem
o
Be detailed! Think about RFC 2324 (HTCPCP)
dem
o
ASP.NET Web APILet’s craft a quick API
What about authN / authZ? API access through OAuth2
Access Control Service to the rescue!
Client authorized in BrewBuddy.net
Access/refresh tokens through ACS
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
dem
o
Access Control Service for API’sOAuth2 delegation
Install-Package WindowsAzure.Acs.Oauth2 -IncludePrerelease
Takeaways
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
Thank you!
http://blog.maartenballiauw.be
@maartenballiauw
http://amzn.to/pronuget