Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Azure Web Sites
Things they don’t teach kids in school
Maarten Balliauw
@maartenballiauw
Who am I?
Maarten Balliauw
Antwerp, Belgium
Technical Evangelist, JetBrains
Founder, MyGet
AZUG
Focus on web
ASP.NET MVC, ...
Agenda
Azure Web Sites
Architecture
Project Kudu
Kudu kung-fu
Application log streaming
Managing settings
Staging and Prod...
Azure Web Sites
Start Simple
start free, scale up and out
as you go, friction-free
and without the headaches
Your way
with asp.net, php or...
demo
Azure Web Sites
Architecture
Azure Web Sites use Azure
Cloud Services + load balancer
Load-balanced Layer 7 reverse proxy
Actual infrastructure
Blob st...
Web Sites are not always in IIS.
They only are when requests come!
Azure
LB
Runtime
DB
Storage
Controller
IIS ARR
(LB)
Web Worker
Other
databases
1st request (cold site)
Storage
Controller
IIS ARR
(LB)
Web Worker
Other
databases
xth request (hot site)
Azure
LB
Runtime
DB
Azure
LB
Storage
Controller
IIS ARR
(LB)
Web Worker
X-DriveDeployment
Server
Other
databas
es
SQL Azure
Blob st...
Need some
proof?
Windows Azure Pack
(http://www.microsoft.com/en-
us/server-cloud/windows-
azure-pack.aspx)
Or:
http://blo...
Project Kudu
Project Kudu
“The engine behind git deployments on Windows Azure”
Open source (www.github.com/projectkudu/kudu)
Provides g...
demo
Project Kudu
demo
Project Kudu
on Azure Web Sites
Kudu kung-fu
Let’s be agile...
Demos
Application log streaming
Managing settings
Staging and Production
Multi-tier deployments
Customiz...
demo
Application log
streaming
Log streaming
All logs from the LogFiles/Application folder
Or configure it when querying: azure log tail <site> -p http
S...
demo
Managing settings
and secrets!
demo
Staging and
production
(there are more ways to do this)
demo
Multi-tier
Deploying a specific project file
Multi-tier remarks…
One .deployment file per branch
[config]
project=MultiTier.WebApi/MultiTier.WebApi.csproj
How do I dep...
Customizing the build process
Check https://github.com/projectkudu/kudu/wiki/Deployment-hooks
.deployment file
[config]
co...
What can I do in scripts?
A lot :-) (but not too much… there’s a sandbox)
Environment variables:
DEPLOYMENT_SOURCE
DEPLOYM...
demo
Customizing
deployments
Sample deployment script
Great… but why?
Deploy an advanced multi-tier scenario
We can download stuff (NuGet package restore, pull in external Git ...
demo
Customizing
deployments
What about running unit tests?
Post-Deployment scripts
https://github.com/projectkudu/kudu/wiki/Post-Deployment-Action-Hooks
Deploy to other regions once...
demo
Running Web Jobs
(background processes)
Web Jobs
There is lots more!
http://www.asp.net/aspnet/overvi
ew/developing-apps-with-
windows-azure/azure-webjobs-
recomm...
demo
Visual Studio Online
Conclusion
Key takeaways
Azure Web Sites are hosted on Azure, high density
Based on Project Kudu
Kudu kung-fu
Application log streami...
Thank you!
http://blog.maartenballiauw.be
@maartenballiauw
http://amzn.to/pronuget
Azure Web SItes - Things they don't teach kids in school - Multi-Mania
Upcoming SlideShare
Loading in …5
×

Azure Web SItes - Things they don't teach kids in school - Multi-Mania

1,692 views

Published on

Microsoft has a cloud platform which runs .NET, NodeJS and PHP. All 101 talks out there will show you the same: it’s easy to deploy, it scales out on demand and it runs WordPress. Great! But what about doing real things? In this session, we’ll explore the things they don’t teach kids in school. How about trying to find out the architecture of this platform? What about the different deployment options for Windows Azure Web Sites, the development flow and some awesome things you can do with the command line tools? Did you know you can modify the automated build process? Join me in this exploration of some lesser known techniques of the platform.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Azure Web SItes - Things they don't teach kids in school - Multi-Mania

  1. 1. Azure Web Sites Things they don’t teach kids in school Maarten Balliauw @maartenballiauw
  2. 2. Who am I? Maarten Balliauw Antwerp, Belgium Technical Evangelist, JetBrains Founder, MyGet AZUG Focus on web ASP.NET MVC, Azure, SignalR, ... MVP Azure & ASPInsider Big passion: Azure http://blog.maartenballiauw.be @maartenballiauw Shameless self promotion: Pro NuGet - http://amzn.to/pronuget2
  3. 3. Agenda Azure Web Sites Architecture Project Kudu Kudu kung-fu Application log streaming Managing settings Staging and Production Multi-tier deployments Customizing deployments Running “jobs” (batch files / background processes) Visual Studio Online
  4. 4. Azure Web Sites
  5. 5. Start Simple start free, scale up and out as you go, friction-free and without the headaches Your way with asp.net, php or node.js, develop on Windows, OSX or Linux Go Live deploy live in seconds, easily monitor performance, rapidly diagnose and fix issues online IDE Web Sites in Seconds
  6. 6. demo Azure Web Sites
  7. 7. Architecture
  8. 8. Azure Web Sites use Azure Cloud Services + load balancer Load-balanced Layer 7 reverse proxy Actual infrastructure Blob storage Your web site is on here (GRS) SQL Azure Your web site config + metering is on here
  9. 9. Web Sites are not always in IIS. They only are when requests come!
  10. 10. Azure LB Runtime DB Storage Controller IIS ARR (LB) Web Worker Other databases 1st request (cold site)
  11. 11. Storage Controller IIS ARR (LB) Web Worker Other databases xth request (hot site) Azure LB
  12. 12. Runtime DB Azure LB Storage Controller IIS ARR (LB) Web Worker X-DriveDeployment Server Other databas es SQL Azure Blob storage Azure Worker Role Provisioning / API Frontend Metering DWAS Site (W3WP.exe)Site (W3WP.exe) Site (W3WP.exe) The full picture
  13. 13. Need some proof? Windows Azure Pack (http://www.microsoft.com/en- us/server-cloud/windows- azure-pack.aspx) Or: http://blog.maartenballiauw.be/ post/2012/07/24/Hands-on- Windows-Azure-Services-for- Windows.aspx
  14. 14. Project Kudu
  15. 15. Project Kudu “The engine behind git deployments on Windows Azure” Open source (www.github.com/projectkudu/kudu) Provides git deployments Provides builds Provides sandboxing Provides hosting
  16. 16. demo Project Kudu
  17. 17. demo Project Kudu on Azure Web Sites
  18. 18. Kudu kung-fu
  19. 19. Let’s be agile... Demos Application log streaming Managing settings Staging and Production Multi-tier deployments Customizing deployments Running “jobs” (batch files / background processes) Visual Studio Online
  20. 20. demo Application log streaming
  21. 21. Log streaming All logs from the LogFiles/Application folder Or configure it when querying: azure log tail <site> -p http Settings DIAGNOSTICS_LASTRESORTFILE -> file to log to when diagnostics go wrong DIAGNOSTICS_LOGGINGSETTINGSFILE -> settings file (json) DIAGNOSTICS_TEXTTRACELOGDIRECTORY -> default folder DIAGNOSTICS_TEXTTRACEMAXLOGFILESIZEBYTES-> log rotation (bytes) DIAGNOSTICS_TEXTTRACEMAXLOGFOLDERSIZEBYTES -> max log size (bytes)
  22. 22. demo Managing settings and secrets!
  23. 23. demo Staging and production (there are more ways to do this)
  24. 24. demo Multi-tier Deploying a specific project file
  25. 25. Multi-tier remarks… One .deployment file per branch [config] project=MultiTier.WebApi/MultiTier.WebApi.csproj How do I deploy all tiers in a separate website? .deployment file per branch and every tier in a branch or customize the build or add an environment variable How do I deploy all tiers in the same website? No .deployment file, just use virtual directories
  26. 26. Customizing the build process Check https://github.com/projectkudu/kudu/wiki/Deployment-hooks .deployment file [config] command=<whatever command> Write in batch file, bash script, PHP, JavaScript, …
  27. 27. What can I do in scripts? A lot :-) (but not too much… there’s a sandbox) Environment variables: DEPLOYMENT_SOURCE DEPLOYMENT_TARGET DEPLOYMENT_TEMP WEBROOT_PATH MSBUILD_PATH KUDU_SYNC_CMD + everything you feed it through the management portal
  28. 28. demo Customizing deployments Sample deployment script
  29. 29. Great… but why? Deploy an advanced multi-tier scenario We can download stuff (NuGet package restore, pull in external Git repos before build) We can run stuff (msbuild, nuget.exe, curl, php, node, …)
  30. 30. demo Customizing deployments What about running unit tests?
  31. 31. Post-Deployment scripts https://github.com/projectkudu/kudu/wiki/Post-Deployment-Action-Hooks Deploy to other regions once the first succeeds Send an e-mail notification Update database Send a Tweet …
  32. 32. demo Running Web Jobs (background processes)
  33. 33. Web Jobs There is lots more! http://www.asp.net/aspnet/overvi ew/developing-apps-with- windows-azure/azure-webjobs- recommended-resources Web Jobs SDK - react to what happens in blob, table, queue Run jobs continuously Run jobs scheduled Run jobs at interval Run jobs on demand (manual / API) class Program { static void Main(string[] args) { JobHost host = new JobHost(); host.RunAndBlock(); } public static void SquishNewlyUploadedPNGs( [BlobInput("input/{name}")] Stream input, [BlobOutput("output/{name}")] Stream output) { var quantizer = new WuQuantizer(); using (var bitmap = new Bitmap(input)) { using (var quantized = quantizer.QuantizeImage(bitmap)) { quantized.Save(output, ImageFormat.Png); } } } }
  34. 34. demo Visual Studio Online
  35. 35. Conclusion
  36. 36. Key takeaways Azure Web Sites are hosted on Azure, high density Based on Project Kudu Kudu kung-fu Application log streaming Managing settings Staging and Production Multi-tier deployments Customizing deployments Running “jobs” (batch files / background processes) Visual Studio Online
  37. 37. Thank you! http://blog.maartenballiauw.be @maartenballiauw http://amzn.to/pronuget

×