Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Евгений Савченко «Azure App Services для .NET и не только»

DotNetRu
December 06, 2019

Евгений Савченко «Azure App Services для .NET и не только»

DotNetRu

December 06, 2019
Tweet

More Decks by DotNetRu

Other Decks in Programming

Transcript

  1. Azure App Services для .Net и не только KrdDotNet 0x02

    Evgeniy Savchenko DevOps Engineer @Arkadium www.arkadium.com
  2. About me Evgeniy Savchenko DevOps engineer (Arkadium Inc) 10+ years

    in IT (InfoSec, Infrastructure, DevOps) 4+ years with Azure Microsoft Certified Solutions Expert: Cloud Platform and Infrastructure 2
  3. Azure App Service overview Azure App Service - fully managed

    PaaS solution for developers to build Web, mobile and API applications Key features: • Multiple languages and frameworks: ASP.NET, ASP.NET Core, Java, Ruby, Node.js, PHP, Python • Easiest deploy: IDE, Azure DevOps, GitHub, BitBucket, Docker Hub, CLI • Scale and high availability: manually or automatically scale up or out, SLA: 99,95 % • Cost optimization: Pay-as-you-go, combine multiple applications together • Built-in security: Updates and patches, SSL, Azure Active Directory integration, ISO and PCI compliant • Also: Deployment Slots, Kudu, Performance test, CORS, Logs, Monitoring 7
  4. Azure App Service plans App Service plan defines a set

    of compute resources for a web app to run. 8
  5. Demo ASP.NET Core app with VS Code Requirements Azure account

    .NET Core SDK C# Extension for Visual Studio Code Azure App Service Extension for Visual Studio Code 10
  6. Demo Create Azure resources # Login to Azure az login

    # Create Resource Group az group create -l centralus --name "krddotnet-demo-rg" # Create App Service Plan with free tier az appservice plan create --name "krddotnet-demo-asp" --resource-group "krddotnet-demo-rg" --sku F1 # Create WebApp az webapp create --resource-group "krddotnet-demo-rg" --plan "krddotnet-demo-asp" --name "krddotnet-demo-app" 14
  7. Azure App Service architecture: Windows High level 20 App Service

    Plan WebApp 1 WebApp 2 WebApp 3 WebApp ... VM 1 VM 2 VM ... Deployed on Runs on
  8. Azure App Service architecture: Windows 21 Web App 1 Web

    App 1 VM 1 VM 2 Azure Storage W3WP.EXE W3WP.EXE App Service Plan D:\local D:\home D:\local D:\home D:\App1 D:\App1 App1 VM local storage VM local storage Load Balancer Deeper: One Web App Compute Each app runs inside its own sandbox Storage D:\local\ – temporary storage resets after WebApp restart (%APPDATA%, %TMP%, etc) D:\home\ – persistent storage shared between all instances, backed by Azure Storage (%HOME%)
  9. Azure App Service architecture: Windows Deeper: Several Web Apps 22

    Web App 1 VM 1 Azure Storage W3WP.EXE App Service Plan D:\local D:\home VM local storage Load Balancer Web App 2 W3WP.EXE D:\local D:\home Web App 3 W3WP.EXE D:\local D:\home D:\App1 D:\App2 D:\App3 App1 App2 App3 Web App 1 VM 1 W3WP.EXE D:\local D:\home VM local storage Web App 2 W3WP.EXE D:\local D:\home Web App 3 W3WP.EXE D:\local D:\home D:\App1 D:\App2 D:\App3
  10. Advanced features Deployment slots 25 # Create deployment slot az

    webapp deployment slot create -g krddotnet-demo-rg -n krddotnet-demo-app --slot staging # Swap staging and production az webapp deployment slot swap -g krddotnet-demo-rg -n krddotnet-demo-app --slot staging - -target-slot production * Can be done via Azure Portal, API, etc.
  11. Advanced features Application Insights Requests (rates, response time, failures) Dependency

    (rates, response time, failures) Exceptions Page views, users, session AJAX calls Performance counters Diagnostic trace logs Custom events and metrics 29
  12. Advanced features Scaling: automatically Configuration • CLI/PoS/Azure Portal/etc Settings •

    Instance limits: Min/Max/Default • Metrics: CPU/RAM/Disk/Network/Custom • Behavior: Threshold/Time grain/Duration/Cool down • Schedule: Repeat days/Start, end dates 33
  13. Experience 35 My opinion Pros Easy to start Good way

    to adopt cloud experience Significantly reduce support time (costs) A lot of “free” features
  14. Experience 36 My opinion Cons Too simple Some things are

    out of your control Few T-shirt sizes Resources overhead
  15. Experience My recommendations Use different Service Plans for different services

    Use minimum 2 instances Use autoscaling Use AppInsight on server side Design application to be self healing Automate deployment of app and infrastructure Use CDN to offload 37