Azure Web SItes - Things they don't teach kids in school - Multi-Mania
-
Upload
maarten-balliauw -
Category
Technology
-
view
599 -
download
0
description
Transcript of Azure Web SItes - Things they don't teach kids in school - Multi-Mania
![Page 1: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/1.jpg)
Azure Web SitesThings they don’t teach kids in schoolMaarten Balliauw@maartenballiauw
![Page 2: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/2.jpg)
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
![Page 3: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/3.jpg)
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
Alt+Shift+Up
![Page 4: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/4.jpg)
Azure Web Sites
![Page 5: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/5.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 issuesonline IDE
Web Sites in Seconds
![Page 6: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/6.jpg)
dem
o
Azure Web Sites
![Page 7: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/7.jpg)
Architecture
![Page 8: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/8.jpg)
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
![Page 9: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/9.jpg)
Web Sites are not always in IIS. They only are when requests come!
![Page 10: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/10.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 11: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/11.jpg)
Storage Controller
IIS ARR(LB)
Web Worker
Other database
s
1 2
3
3
3
3
xth request (hot site)
Azure LB
![Page 12: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/12.jpg)
Runtime DB
Azure LB
Storage Controller
IIS ARR(LB)
Web Worker
X-DriveDeployment Server
Other databa
ses
SQL Azure
Blob storage
Azure Worker Role
Provisioning / API Frontend
Metering
DWAS
Site (W3WP.exe)Site (W3WP.exe)
Site (W3WP.exe)
The full picture
![Page 13: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/13.jpg)
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
![Page 14: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/14.jpg)
Project Kudu
![Page 15: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/15.jpg)
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
![Page 16: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/16.jpg)
dem
o
Project Kudu
![Page 17: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/17.jpg)
dem
o
Project Kuduon Azure Web Sites
![Page 18: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/18.jpg)
Kudu kung-fu
![Page 19: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/19.jpg)
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
Alt+Shift+Up
![Page 20: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/20.jpg)
dem
o
Application log streaming
![Page 21: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/21.jpg)
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)
![Page 22: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/22.jpg)
dem
o
Managing settingsand secrets!
![Page 23: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/23.jpg)
dem
o
Staging and production(there are more ways to do this)
![Page 24: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/24.jpg)
dem
o
Multi-tierDeploying a specific project file
![Page 25: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/25.jpg)
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
![Page 26: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/26.jpg)
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, …
![Page 27: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/27.jpg)
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
![Page 28: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/28.jpg)
dem
o
Customizing deploymentsSample deployment script
![Page 29: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/29.jpg)
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, …)
![Page 30: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/30.jpg)
dem
o
Customizing deploymentsWhat about running unit tests?
![Page 31: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/31.jpg)
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
…
![Page 32: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/32.jpg)
dem
oRunning Web Jobs(background processes)
![Page 33: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/33.jpg)
Web Jobs There is lots more! http://www.asp.net/aspnet/overview/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); } } }}
![Page 34: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/34.jpg)
dem
o
Visual Studio Online
![Page 35: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/35.jpg)
Conclusion
![Page 36: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/36.jpg)
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
![Page 37: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/37.jpg)
Thank you!http://blog.maartenballiauw.be@maartenballiauwhttp://amzn.to/pronuget
![Page 38: Azure Web SItes - Things they don't teach kids in school - Multi-Mania](https://reader036.fdocuments.net/reader036/viewer/2022062303/554f8d40b4c905435d8b4e85/html5/thumbnails/38.jpg)