Windows Azure Web Sites – things they don’t teach kids in school - AzureConf
-
Upload
maarten-balliauw -
Category
Technology
-
view
985 -
download
0
description
Transcript of Windows Azure Web Sites – things they don’t teach kids in school - AzureConf
![Page 1: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/1.jpg)
Maarten Balliauw@maartenballiauw
Windows Azure Web SitesThings they don’t teach kids in school
![Page 2: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/2.jpg)
Windows Azure Global Bootcamp
Over 60 community-led Windows Azure training events worldwide!
http://globalwindowsazure.azurewebsites.net
![Page 3: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/3.jpg)
• Maarten Balliauw• Technical Evangelist, JetBrains• AZUG• Focus on web
• ASP.NET MVC, Windows Azure, SignalR, ...• MVP Windows Azure & ASPInsider
• Big passion: Windows Azure• http://blog.maartenballiauw.be • @maartenballiauw
Who am I?
Shameless self promotion: Pro NuGet - http://amzn.to/pronuget
![Page 4: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/4.jpg)
Agenda
• Windows Azure Web Sites• Architecture• Project Kudu• Kudu kung-fu
![Page 5: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/5.jpg)
Windows AzureWeb Sites
![Page 6: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/6.jpg)
Start Simplestart free, scale up and out as you go, friction-free and without the headaches
Your waywith asp.net, php or node.js, develop on Windows, OSX or Linux
Go Livedeploy live in seconds,
easily monitor performance, rapidly diagnose and fix issues
Web Sites in Seconds
![Page 7: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/7.jpg)
Windows AzureWeb Sites
demo
![Page 8: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/8.jpg)
Architecture
![Page 9: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/9.jpg)
disclaimer
![Page 10: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/10.jpg)
• Layers• 1st layer: Windows Azure load balancer• 2nd layer: IIS + ARR
• ARR• “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
Load balancer
![Page 11: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/11.jpg)
• %SYSTEM32%\inetsrv\config\applicationHost.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
Web servers
![Page 12: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/12.jpg)
Web Sites are not in IIS. They only are when a request
comes in!
![Page 13: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/13.jpg)
Azure LB
Runtime DB
Storage Controller
IIS ARR(LB)
Web Worker
Other databases
1
2
3
4
5
5
5
5
1st request (cold site)
![Page 14: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/14.jpg)
Storage Controller
IIS ARR(LB)
Web Worker
Other database
s
1 2
3
3
3
3
xth request (hot site)
Azure LB
![Page 15: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/15.jpg)
Your app not being used for a while?
devopsreactions.tumblr.com
![Page 16: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/16.jpg)
• 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
Provisioning, publishing, metering
![Page 17: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/17.jpg)
Runtime DB
Azure LB
Storage Controller
IIS ARR(LB)
Web Worker
X-DriveDeployment Server
Other databas
es
SQL Azure
Blob storage
Windows Azure Worker Role
Provisioning / API Frontend
Metering
DWAS
Site (W3WP.exe)Site (W3WP.exe)
Site (W3WP.exe)
Provisioning, publishing, metering
![Page 18: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/18.jpg)
• Windows Azure Web Sites runs on Windows Azure Cloud Services
• ARR nodes are in fault/update domains• Web Workers are in fault/update domains• Storage nodes are in fault/update domains• Data is on SQL Azure• Files are on blob storage
What I find awesome…
![Page 19: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/19.jpg)
Let’s find some proof…
demo
![Page 20: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/20.jpg)
Need more proof?Windows Azure Services for Windows Server (http://www.microsoft.com/hosting/en/us/services.aspx)
Or:
http://blog.maartenballiauw.be/post/2012/07/24/Hands-on-Windows-Azure-Services-for-Windows.aspx
![Page 21: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/21.jpg)
Project Kudu
![Page 22: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/22.jpg)
• “The engine behind git deployments on Windows Azure”
• Open source (www.github.com/projectkudu/kudu)
• Provides git deployments• Provides builds• Provides sandboxing• Provides hosting
Project Kudu
![Page 23: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/23.jpg)
Project Kudu
demo
![Page 24: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/24.jpg)
Kudukung-fu
![Page 25: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/25.jpg)
Application log streaming
demo
![Page 26: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/26.jpg)
• 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)
Log streaming
![Page 27: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/27.jpg)
Managing settingsand secrets
demo
![Page 28: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/28.jpg)
Staging and production
demo
![Page 29: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/29.jpg)
Multi-tierDeploying a specific project file
demo
![Page 30: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/30.jpg)
• 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
Multi-tier remarks…
![Page 31: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/31.jpg)
• Check https://github.com/projectkudu/kudu/wiki/Deployment-hooks
• .deployment file• [config]command=<whatever command>
• Write in batch file, bash script, PHP, JavaScript, …
Customizing the build process
![Page 32: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/32.jpg)
Customizing deploymentsan introductiondemo
![Page 33: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/33.jpg)
• 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
What can I do in scripts?
![Page 34: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/34.jpg)
Customizing deploymentssample deployment scriptdemo
![Page 35: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/35.jpg)
• 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, …)
Great… but why?
![Page 36: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/36.jpg)
Customizing deploymentswhat about unit tests?demo
![Page 37: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/37.jpg)
Need. Moar!
![Page 38: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/38.jpg)
• REST API https://github.com/projectkudu/kudu/wiki/REST-API
• DropBox support
• Creating a custom handlerhttp://www.windowsazure.com/en-us/develop/python/tutorials/web-sites-with-django/
Moar out of the box
![Page 39: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/39.jpg)
Need. MOAR!!!
![Page 40: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/40.jpg)
A private Kudu build in web sites?
![Page 41: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/41.jpg)
• 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 http://blog.davidebbo.com/2012/06/developing-kudu-locally-and-on-azure.html
A private Kudu build in web sites?
![Page 42: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/42.jpg)
Conclusion
![Page 43: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/43.jpg)
• 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• Kudu-in-Kudu
Key takeaways
![Page 44: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/44.jpg)
Thank you!
http://blog.maartenballiauw.be
@maartenballiauw
http://amzn.to/pronuget
![Page 45: Windows Azure Web Sites – things they don’t teach kids in school - AzureConf](https://reader036.fdocuments.net/reader036/viewer/2022070316/555ab733d8b42ad0538b5499/html5/thumbnails/45.jpg)
http://aka.ms/AzureConf-MemberOffers
http://aka.ms/AzureConf-FreeTrial
Get started with a 90 day free trial
Or, use your existing benefits…