Антон Бойко "Azure Web Apps deep dive"

41
Web Apps deep dive Anton Boyko Microsoft Azure MVP, MCP Microsoft TE [email protected] [email protected]

Transcript of Антон Бойко "Azure Web Apps deep dive"

Page 1: Антон Бойко "Azure Web Apps deep dive"

Web Apps deep dive

Anton Boyko Microsoft Azure MVP, MCP Microsoft TE [email protected] [email protected]

Page 2: Антон Бойко "Azure Web Apps deep dive"

Before we start If you have any questions – do not hesitate and ask them right here and right now.

Page 3: Антон Бойко "Azure Web Apps deep dive"
Page 4: Антон Бойко "Azure Web Apps deep dive"

App Service - one integrated offering

APIAppsEasily build and consume APIs in

the cloud

WebAppsWeb apps that scale with your business

MobileAppsBuild Mobile apps

for any device

LOGICAppsAutomate business

process across SaaS and on-

premises

Page 5: Антон Бойко "Azure Web Apps deep dive"

.NET | Node.js | PHP | Python | Java

Develop apps with…

Page 6: Антон Бойко "Azure Web Apps deep dive"

Web apps architecture

Microso4AzureLoadBalancer

Run<meDatabase

Applica<onDatabase

APIEndpoint

Frontend(IISARR)

PublishEndpoint BlobStorage

FileServer

Metering

DeploymentServer

Page 7: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why do I need to have 2 load balancers that should do more or less the same job?

Page 8: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why do I need to have 2 load balancers that should do more or less the same job?

Azure network load balancer works on L4 of network protocol and is only able to operate with protocol and port number. IIS ARR works on L7 and is able to work on HTTP level. ISS ARR is able to handle “sticky sessions”.

Page 9: Антон Бойко "Azure Web Apps deep dive"
Page 10: Антон Бойко "Azure Web Apps deep dive"

Source control integration

Page 11: Антон Бойко "Azure Web Apps deep dive"

GitHubVisualStudioTeamServices

Git BitBucketCodePlex DropBox FTP

Choose your own adventure!

Page 12: Антон Бойко "Azure Web Apps deep dive"

Generate deployment script

Page 13: Антон Бойко "Azure Web Apps deep dive"

Edit deployment script :: 5. Build IF EXIST "%DEPLOYMENT_TARGET%\gruntfile.js" ( echo "grunt build" pushd "%DEPLOYMENT_TARGET%" call :ExecuteCmd npm install grunt-cli grunt build IF !ERRORLEVEL! NEQ 0 goto error popd )

Page 14: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why having a CPU-intensive long running build process on top of Kudu can kill your app?

Page 15: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why having a CPU-intensive long running build process on top of Kudu can kill your app?

Kudu runs on the same nodes as your web app and they share all resources.

Page 16: Антон Бойко "Azure Web Apps deep dive"

Auto scale

Page 17: Антон Бойко "Azure Web Apps deep dive"
Page 18: Антон Бойко "Azure Web Apps deep dive"
Page 19: Антон Бойко "Azure Web Apps deep dive"
Page 20: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why web apps auto scale feature can kill your app?

Page 21: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why web apps auto scale feature can kill your app?

• Scale is not instantaneous

• Only the web tier scales

Page 22: Антон Бойко "Azure Web Apps deep dive"

It’s not about “don’t use auto scale” for the web apps, it’s more about “use your head”.

Page 23: Антон Бойко "Azure Web Apps deep dive"

Deployment slots

Page 24: Антон Бойко "Azure Web Apps deep dive"

Deployment slots

swapStaging

slot

Produc<onslot

Streamline dev, test and producBon deployment workflow Swap staging and producBon with zero downBme Instantaneous rollback to previous “last known good site” Enables A/B tesBng, conBnuous deployment, staged publishing and much more

WebApp

Page 25: Антон Бойко "Azure Web Apps deep dive"
Page 26: Антон Бойко "Azure Web Apps deep dive"

If you want to live in harmony with the rest of the world – avoid running load tests on different deployment slots of the same web app.

Page 27: Антон Бойко "Azure Web Apps deep dive"

Traffic manager

Page 28: Антон Бойко "Azure Web Apps deep dive"

www.yourapp.com

Page 29: Антон Бойко "Azure Web Apps deep dive"

www.yourapp.com

Page 30: Антон Бойко "Azure Web Apps deep dive"

Quiz

What will traffic manager do if you start receiving 404 or 500 http status codes while trying to access your app main page? Why?

Page 31: Антон Бойко "Azure Web Apps deep dive"

Quiz

What will traffic manager do if you start receiving 404 or 500 http status codes while trying to access your app main page? Why?

Traffic manager uses an endpoint monitoring rules that consist of protocol, port and path. It checks only this particular endpoint for your app health status, it does not listen to all traffic.

Page 32: Антон Бойко "Azure Web Apps deep dive"

Auto heal

Page 33: Антон Бойко "Azure Web Apps deep dive"

Auto heal triggers <system.webServer> <monitoring> <triggers> <!-- Scenario #1: Recycling based on Request Count --> <requests count="1000" timeInterval="00:10:00"/> <!-- Scenario #2: Recycling based on slow requests --> <slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" /> <!-- Scenario #3: Logging an event (or recycling) based on status code(s) --> <statusCode> <add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/> </statusCode> <!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit --> <memory privateBytesInKB="800000"/>

Page 34: Антон Бойко "Azure Web Apps deep dive"

Auto heal actions </triggers> <!-- Scenario #1 & #2 Action --> <actions value="Recycle"/> <!-- Scenario #3 Action --> <actions value="LogEvent"/> <!-- Scenario #4 Action --> <actions value="CustomAction"> <customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" /> </actions>

Page 35: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why using auto heal can kill your app?

Page 36: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why using auto heal can kill your app?

If you face an issue when recycling is not enough to fix your app, you will also face infinite recycling loop.

Page 37: Антон Бойко "Azure Web Apps deep dive"

Backup

Page 38: Антон Бойко "Azure Web Apps deep dive"

What can I backup? • Web app content

•  Web app root folder and all folders underneath • Application database

•  Only those application databases, which have connection strings in web app connection string settings, not in web.config

• Configuration settings •  Configuration settings of web app

Page 39: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why I’m not 100% happy with backup?

Page 40: Антон Бойко "Azure Web Apps deep dive"

Quiz

Why I’m not 100% happy with backup?

Usually I put my unstructured content (pictures, video, etc.) into blob storage to avoid storage limit of web app pricing tier. There is no way to backup it using built-in backup feature.

Page 41: Антон Бойко "Azure Web Apps deep dive"

Questions? Anton Boyko Microsoft Azure Ukraine Community Founder Microsoft Azure MVP, MCP Microsoft TE

[email protected] @BoykoAnt https://facebook.com/boyko.ant https://youtube.com/user/boykoant https://ua.linkedin.com/in/boykoant