Giter Club home page Giter Club logo

asp-dot-net-core-on-azure-web-app's Introduction

ALM and DevOps practices with a sample ASP.NET Core 2.0 web app hosted in Azure Web App (Windows and Linux).

TOC

History of changes

Overview

The goal of this GitHub repository is to demonstrate and use DevOps practices by leveraging a very simple ASP.NET Core web application on Azure Web Apps on both platform Windows and Linux. ASP.NET Core has this ability to be cross-platform, so throughout this GitHub repository, with one codebase/project we will see how deploy this web application on both platform: App Service Windows (WebDeploy package) and App Service Linux (Docker container).

By opening the .sln with Visual Studio 2017 you should see the structure of the solution like this:

Visual Studio Solution Structure Overview

To be able to setup the Build and Release definitions within VSTS described in the section below, you will need a Team Services (VSTS) account. If you don't have one, you could create it for free here.

To be able to deploy the Azure services (Function App, Application Insights, etc.), you will need an Azure subscription. If you don't have one, you could create it for free here.

App Service (Windows) - Build and Release Definitions with VSTS

Architecture Overview

For the Build definition, details could be found here: Build - CI

Here are the DevOps practices highlighted within this CI pipeline:

  • CI/Build triggered at each commit on the master branch
  • Compile the ASP.NET Core application
  • Run unit tests
  • Infrastructure as Code with the ARM Templates and the PowerShell scripts
  • Expose artifacts to be used then by the CD pipeline (WebDeploy package, ARM Templates, PowerShell scripts and UITests (Selenium) dlls)
  • Create a bug work item on build failure (assign to requestor)

For the Release definition, details could be found here: Release - CD

Here are the DevOps practices highlighted within this CD pipeline:

  • CD triggered at each CI/Build succesfully completed
  • Deploy the Infrastructure as Code with the ARM Templates and the PowerShell scripts
  • Deploy the ASP.NET Core application on an Azure PaaS service: Azure App Service (Web App) on Windows
  • Run UITests (Selenium) once the Web App is deployed on Staging
  • Use the Staging Slot mechanism with the associated Swap action to minimize downtime while upgrading the Production
  • Use Entity Framework code-first approach to manage the database migrations
  • Securing the production environment by adding a Lock on the associated Azure Resource Group
  • Monitor the Web App by using Application Insights

App Service (Linux) - Build and Release Definitions with VSTS

Architecture Overview

For the Build definition, details could be found here: Build - CI

Here are the DevOps practices highlighted within this CI pipeline:

  • CI/Build triggered at each commit on the master branch
  • Compile the ASP.NET Core application
  • Run unit tests
  • Infrastructure as Code with the ARM Templates and the PowerShell scripts
  • Publish the web app as a Docker container in an Azure Container Registry
  • Expose artifacts to be used then by the CD pipeline (ARM Templates, PowerShell scripts and UITests (Selenium) dlls)
  • Create a bug work item on build failure (assign to requestor)

For the Release definition, details could be found here: Release - CD

Here are the DevOps practices highlighted within this CD pipeline:

  • CD triggered at each CI/Build succesfully completed
  • Deploy the Infrastructure as Code with the ARM Templates and the PowerShell scripts
  • Deploy the Docker container on an Azure PaaS service: Azure App Service (Web App) on Linux
  • Run UITests (Selenium) once the Web App is deployed on Staging
  • Use the Staging Slot mechanism with the associated Swap action to minimize downtime while upgrading the Production
  • Use Entity Framework code-first approach to manage the database migrations
  • Securing the production environment by adding a Lock on the associated Azure Resource Group
  • Monitor the Web App by using Application Insights

Other Misc DevOps practices implemented

  • GitHub as source control to leverage key features for collaboration such as feature-branch with pull request, etc.
  • CI/CD definitions as Code with the exported yml and json files of the Build and Release Definitions respectively

Alternatives

  • Instead of using an Azure Container Registry to expose the Docker container, use DockerHub instead.
  • Instead of having an ASP.NET Core web application, use a NodeJS, Java, etc. web application instead.

Resources

asp-dot-net-core-on-azure-web-app's People

Contributors

mathieu-benoit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.