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.

Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT


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: Travel, Technology
  • Be the first to comment

Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT

  1. 1. Windows Azure Web Sites Things they don’t teach kids in school Maarten Balliauw @maartenballiauw
  2. 2. Who am I? Maarten Balliauw Technical Evangelist, JetBrains AZUG Focus on web ASP.NET MVC, Windows Azure, SignalR, ... MVP Windows Azure & ASPInsider Big passion: Windows Azure @maartenballiauw Shameless self promotion: Pro NuGet
  3. 3. Saturday, March 29, 2014 90+ locations last year, this year let’s go for a 100!
  4. 4. Possibly the largest community event ever MVP’s Speakers Locations Attendees Sessions
  5. 5. Agenda Windows Azure Web Sites Architecture Project Kudu Kudu kung-fu Application log streaming Managing settings Staging and Production Multi-tier deployments Customizing deployments Running batch files / background processes (*)
  6. 6. Windows Azure Web Sites
  7. 7. Web Sites in Seconds Start Simple Your way Go Live start free, scale up and out as you go, friction-free and without the headaches with, php or node.js, develop on Windows, OSX or Linux deploy live in seconds, easily monitor performance, rapidly diagnose and fix issues
  8. 8. demo Windows Azure Web Sites
  9. 9. Architecture
  10. 10. Load balancer Layers 1st layer: Windows Azure load balancer 2nd layer: IIS + ARR ARR (disclaimer: not ) “Reverse proxy” Verifies hosting database (plans, quotas, …) Negotiates best node to run your site on Site not used much? Put it on a highly loaded machine
  11. 11. Web servers %SYSTEM32%inetsrvconfigapplicationHost.config is taken out of the loop SQL Azure No refreshing of all app pools when file is saved Storage “File share” hosted on other machines Using “WA drive” on blob storage Dynamic website activation service Verifies runtime database (plans, quotas, …) Site not used for a while? Remove it from the server
  12. 12. Web Sites are not in IIS. They only are when a request comes in!
  13. 13. 1st request (cold site) Web Worker IIS ARR (LB) Azure LB Runtime DB Other databases Storage Controller
  14. 14. xth request (hot site) Web Worker IIS ARR (LB) Azure LB Other databases Storage Controller
  15. 15. Your app not being used for a while?
  16. 16. Provisioning, publishing, metering Provisioning and publishing Storage and database != launching a website on web farm Metering By web servers once a site is loaded Reported back to runtime database
  17. 17. Provisioning, publishing, metering IIS ARR (LB) Web Worker SQL Azure Site Site (W3WP.exe) Site (W3WP.exe) (W3WP.exe) Runtime DB Metering Azure LB DWAS Blob storage Other databas es Provisioning / API Frontend Deployment Server Storage Controller X-Drive Windows Azure Worker Role
  18. 18. demo Let’s find some proof…
  19. 19. Need more proof? Windows Azure Pack ( Or: post/2012/07/24/Hands-onWindows-Azure-Services-forWindows.aspx
  20. 20. Project Kudu
  21. 21. Project Kudu “The engine behind git deployments on Windows Azure” Open source ( Provides git deployments Provides builds Provides sandboxing Provides hosting
  22. 22. demo Project Kudu
  23. 23. Pointers from the Kudu repository Website extensions (analytics?) Job runner / “worker role” “KuduCalf” (A Kudu is an Antelope. Its baby is a calf. A Kudu Calf is deployed from Kudu.)
  24. 24. Kudu kung-fu
  25. 25. demo Application log streaming
  26. 26. 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)
  27. 27. and secrets! demo Managing settings
  28. 28. demo Staging and production
  29. 29. Deploying a specific project file demo Multi-tier
  30. 30. 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 How do I deploy all tiers in the same website? No .deployment file, just use virtual directories
  31. 31. Customizing the build process Check .deployment file [config] command=<whatever command> Write in batch file, bash script, PHP, JavaScript, …
  32. 32. An introduction demo Customizing deployments
  33. 33. 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 + everything you feed it through the management portal
  34. 34. Sample deployment script demo Customizing deployments
  35. 35. Great… but why? We’ve seen the 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, …)
  36. 36. What about running unit tests? demo Customizing deployments
  37. 37. Note: only in Kudu at this time! demo Running background processes (workers)
  38. 38. Need. Moar!
  39. 39. Moar out of the box REST API Creating a custom handler
  40. 40. Need. MOAR!!!
  41. 41. A private Kudu build in web sites?
  42. 42. A private Kudu build in web sites? Build and FTP the artifacts/debug/KuduService to your website Add USE_PRIVATE_KUDU=1 app setting Enjoy the ride! (but don’t call support, you’re on your own) See
  43. 43. Conclusion
  44. 44. Key takeaways Windows Azure Web Sites are high density Hosted on Cloud Services Kudu is our best friend Settings and secrets Muliple environments Multiple tiers Build customization Unit tests Worker roles Kudu-in-Kudu
  45. 45. http://blog.maartenballiauw. be @maartenballiauw Thank you!