PROJECTCON | AGILECON Midwest 2019 in Indianapolis on May 10, 2019
Presenter: Benjamin Day
Automated Release Pipelines with Azure DevOps
What's DevOps and how do you make it work using Microsoft’s Azure DevOps service? At its core, DevOps is about automating every last thing that you can possibly automate between development and production. Basically, automate away all the annoying & tedious stuff that distracts you from being able to quickly and easily deliver done, working software.
This session will be a mix of the practical (75%) and the theoretical (25%). We'll start by talking about the DevOps mindset and why you should even care about DevOps. From there, we'll dive in to the skills and practices you'll need in order to implement an automated, multi-environment DevOps pipeline using Azure DevOps.
The demo will to take an existing ASP.NET Core application with automated tests, commit it to Git, create automated builds, and an automated release pipeline that'll take the application from development to test to production.
Event Website: https://projectconevent.com
LinkedIn: https://www.linkedin.com/company/projectcon-llc
Facebook: http://www.facebook.com/ProjectConEvent
Twitter: http://www.twitter.com/projectconevent
YouTube: https://www.youtube.com/channel/UCLLG1SGPs1L5YLoFndvGGhQ
Instagram: https://www.instagram.com/projectconevent
Presentation Slides: https://slideshare.com/projectcon
Post Event Trailer: https://youtu.be/1_RzFBnZ7bo
ProjectCon AgileCon Project Management
2. @benday | www.benday.com
Benjamin Day
Brookline, MA
Consultant & Trainer
Scrum, DevOps,
Team Foundation Server,
Software Architecture & Testing
Microsoft MVP
Pluralsight Author
Scrum.org Trainer
@benday
17. @benday | www.benday.com
If delivery & deployment is easy…
…it’s not a big deal to do a release
- (Hopefully, without much human involvement)
…you’ll do releases more often
…you can focus more time writing & delivering features
23. @benday | www.benday.com
DevOps Goals
Version Controlled, Automated, Repeatable
- Ideally, including hosting environment configuration
- (Docker, ARM templates, etc)
Never deploy from a developer workstation
- No right-click deploy
Deploy from TFS Build
Deploy from TFS Release Management Pipeline
24. @benday | www.benday.com
ASP.NET Core & EF Core DevOps Checklist
Code is under version control
Database schema & changes are under version control
Automated tests (unit tests, integration tests, UI tests)
Automated build
Automated release / deployment
25. @benday | www.benday.com
DevOps: Don’t Forget the Database!
Does your app use a database?
- You’ll need to version control it
Automated build & deploy of database schemas
Two approaches:
- SQL Server Data Tools (SSDT)
- Entity Framework Migrations
29. @benday | www.benday.com
EF Core NuGet Packages
Talk to SQL Server
Microsoft.EntityFrameworkCore.SqlServer
Database Updates (“Migrations”)
Microsoft.EntityFrameworkCore.Design
Reverse Engineer a SQL Server Database
Microsoft.EntityFrameworkCore.SqlServer.Design
30. @benday | www.benday.com
Enable the “dotnet ef” Command
Edit *.csproj
Add DotNetCliToolReference to
Microsoft.EntityFrameworkCore.Tools.DotNet
32. @benday | www.benday.com
Migrations from the Command Line
Add / Remove a Migration
dotnet ef migrations add “{name}”
dotnet ef migrations remove
Deploy an Update
dotnet ef database update
33. @benday | www.benday.com
Things you need for EF Core
Entity Framework DB Context
- Starting point for all your database operations
- Microsoft.EntityFrameworkCore.DbContext
IDesignTimeDbContextFactory<T>
- Handles creating instances of DbContext for doing migrations
- Microsoft.EntityFrameworkCore.Design.IDesignTimeDbContextFactory
35. @benday | www.benday.com
Host ASP.NET Core on IIS
Install .NET Core Windows Server Hosting Bundle
- ASP.NET Core 1.* https://go.microsoft.com/fwlink/?linkid=848766
- ASP.NET Core 2.* https://aka.ms/dotnetcore.2.0.0-windowshosting
41. @benday | www.benday.com
ASP.NET Core & EF Core DevOps Checklist
Code is under version control
Database schema & changes are under version control
Automated tests (unit tests, integration tests, UI tests)
Automated build
Automated release / deployment