Your SlideShare is downloading. ×
Windows Azure Web Sites - Things they don’t teach kids in school
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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


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 …

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

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide
  • Maarten
  • Launch PhpStorm, create new websiteExplain command line toolsazure site create WAWSdeepdive --location "North Europe" --gitConfigure gitAdd index.php <phpphpinfo();Commit and pushDisplay in browser and go through “environment”COMPUTERNAME “RD….”NUMBER_OF_PROCESSORS -> x-large instancesAll ARR___ variables (cookies for affinity and so on)WAWebSiteSID for determining the website SIDApparently C:\\DWASFiles\\Sites\\WAWSdeepdive seems “da bomb”Browse through the portal and note:All URLS for FTP and SCM are different hostnames and thus potentially a different group of serversazure site delete WAWSdeepdive
  • Clone from git, run buildWhile build runs, explain what’s happening (NPM stage, …)Run Kudu.Webas administratorCreate a site, show folders, …KuduExec! – browse the filesystem and so onExplore someCd .. Until no more is possible and dir – show \\\\10,x,x,x
  • Show logging applicationExplain nothing special configuredEnable through portalShow stream: azure site log tailmysite(other options are download)Configure verbosity
  • Create an application and use ConfigurationManager.AppSettings["MyKey"] tospecify a ‘dev’ variable or somethingShow environment variable printingUpdate setting in portalFTP into the system and note that the web.config is UNTOUCHED!We can use this for storing secrets
  • Show Hg repository in which I have created two branches: the default one and a “staging” oneConfigure one production websiteConfigure one staging websiteExplain hostnames, scaling, configuration and so on
  • Explain solution structure: two web projectsCreate .deployment fileAdd:[config]project = MultiTier.WebApi/MultiTier.WebApi.csproj
  • Create .deployment fileAdd:[config]command=deploy.cmdAdd deploy.cmd@echo offecho Stacked is TEH AWESOME!echo We are deploying to %MYENV%- Set environment variable in portal
  • Too long for slides!Run azure site deploymentscript --basicOr azure site deploymentscript –aspWAPRun through script
  • Explain unit test projectDeploy with successDeploy with failure
  • Transcript

    • 1. Windows Azure Web SitesThings they don’t teach kids in schoolMaarten Balliauw@maartenballiauw
    • 2. Who am I?Maarten BalliauwTechnical Evangelist, JetBrainsAZUGFocus on web ASP.NET MVC, Windows Azure, SignalR, ... MVP Windows Azure & ASPInsiderBig passion: Windows Azure self promotion: Pro NuGet -
    • 3. AgendaWindows Azure Web SitesArchitectureProject KuduKudu kung-fu
    • 4. Windows Azure Web Sites
    • 5. Web Sites in SecondsStart Simple Your way Go Livestart free, scale up and out with, php or deploy live in seconds,as you go, friction-free node.js, develop on easily monitorand without the headaches Windows, OSX or performance, rapidly Linux diagnose and fix issues
    • 6. demoWindows AzureWeb Sites
    • 7. Architecture
    • 8. Web Sites are not in IIS until a request comes in!
    • 9. Load balancerLayers 1st layer: Windows Azure load balancer 2nd layer: IIS + ARRARR “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
    • 10. Web servers%SYSTEM32%inetsrvconfigapplicationHost.config is taken out of the loop SQL Azure No refreshing of all app pools when file is savedStorage “File share” hosted on other machines Using “WA drive” on blob storageDynamic website activation service Verifies runtime database (plans, quotas, …) Site not used for a while? Remove it from the server
    • 11. 1st request (cold site) Web Worker IIS ARR (LB) Azure Runtime Other LB DB databases Storage Controller
    • 12. xth request (hot site) Web Worker IIS ARR (LB) Azure LB Other databases Storage Controller
    • 13. Your app not being used for a while?
    • 14. Provisioning, publishing, meteringProvisioning and publishing Storage and database != launching a website on web farmMetering By web servers once a site is loaded Reported back to runtime database
    • 15. Provisioning, publishing, metering Web Worker IIS ARR SQL Azure (LB) Site Site Blob storage (W3WP.exe) Site (W3WP.exe) (W3WP.exe) Runtime Windows Azure Worker DB Role OtherAzure Metering databas LB es DWAS Provisioning / API Frontend Storage Deployment Controller X-Drive Server
    • 16. What I find awesome…Windows Azure Web Sites runs on Windows Azure Cloud ServicesARR nodes are in fault/update domainsWeb Workers are in fault/update domainsStorage nodes are in fault/update domainsData is on SQL AzureFiles are on blob storage
    • 17. demoLet’s find someproof…
    • 18. Need moreproof?Windows AzureServices for WindowsServer(
    • 19. Project Kudu
    • 20. Project Kudu“The engine behind git deployments on Windows Azure”Open source ( git deploymentsProvides buildsProvides sandboxingProvides hosting
    • 21. demoProject Kudu
    • 22. Kudu kung-fu
    • 23. demoApplication logstreaming
    • 24. Log streamingAll logs from the LogFiles/Application folderOr configure it when querying: azure log tail <site> -p httpSettings 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)
    • 25. demoManaging settingsand secrets!
    • 26. demoStaging andproduction
    • 27. demoMulti-tierDeploying a specific project file
    • 28. Multi-tier remarks…One .deployment file per branch [config] project=MultiTier.WebApi/MultiTier.WebApi.csprojHow do I deploy all tiers in a separate website? .deployment file per branch and every tier in a branch or customize the build
    • 29. Customizing the build processCheck file [config] command=<whatever command>Write in batch file, bash script, PHP, JavaScript, …
    • 30. demoCustomizingdeploymentsAn introduction
    • 31. What can I do in scripts?A lot  (but not too much… there’s a sandbox)Environment variables: DEPLOYMENT_SOURCE DEPLOYMENT_TARGET DEPLOYMENT_TEMP MSBUILD_PATH + everything you feed it through the management portal
    • 32. demoCustomizingdeploymentsSample deployment script
    • 33. Great… but why?We’ve seen the multi-tier scenarioWe can download stuff (NuGet package restore, pull in external Git reposbefore build)We can run stuff (msbuild, nuget.exe, curl, php, node, …)
    • 34. demoCustomizingdeploymentsWhat about running unit tests?
    • 35. Need. Moar!
    • 36. Moar out of the boxREST API supportCreating a custom handler
    • 37. Need. MOAR!!!
    • 38. A private Kudu build in web sites?
    • 39. A private Kudu build in web sites?Build and FTP the artifacts/debug/KuduService to your websiteAdd USE_PRIVATE_KUDU=1 app settingEnjoy the ride! (but don’t call support, you’re on your own)See
    • 40. Conclusion
    • 41. Key takeawaysWindows Azure Web Sites are high densityHosted on Cloud ServicesKudu is our best friend Settings and secrets Muliple environments Multiple tiers Build customization Unit tests Kudu-in-Kudu
    • 42. http://blog.maartenballiauw. be @maartenballiauw you!