Deploying an ASP.NET Core web app to Linux - Will it Deploy? Episode 7

Published on: 9 May 2018 by: Rob Pearson

Welcome to another Will it Deploy? episode where we try to automate the deployment of different technologies with Octopus Deploy. In this episode, we're trying to deploy an ASP.NET Core 2.0 web app to an Amazon Web Services (AWS) Ubuntu Linux Virtual Machine (VM) with SQL Server for Linux. We also explore setting up a cloud-based delivery pipeline with AppVeyor and Octopus.

NOTE: Octopus Cloud is coming soon! Register your interest and stay up to date with our cloud-based solution.

Problem

Tech Stack

Our app is a random quote generator web app called Random Quotes. This is fairly simple, but it'll allow us to walk through how to automate the deployment of an ASP.NET Core web application with a database to an Ubuntu Linux VM and SQL Server for Linux running in AWS.

Kudos to our marketing manager Andrew who has been learning to code and built the first cut of this app. Nice job!

Deployment Target

Amazon web services logo

Solution

So will it deploy? Yes it will!

Our cloud-based delivery pipeline looks like the following:

GitHub, AppVeyor and Octopus delivery pipeline

We're committing our source code to GitHub, building our app automatically with AppVeyor, and deploying to an AWS Ubuntu VM with Octopus.

It's quick and easy to integrate AppVeyor with Octopus. We're using a custom build script to build and package our application and we configure the 'Octopus Deploy' deployment provider to deploy it.

AppVeyor build settings

AppVeyor deployment provider settings

Our deployment process looks like the following:

Octopus deployment process

  • Octopus Deploy a Package step to acquire/unzip our database scripts on the Octopus Server.
  • Octopus Community Contributed step template - SQL - Execute Script File to execute our Entity Framework Core migration script agaist our SQL Server database.
  • Octopus Deploy a Package step to deploy our ASP.NET Core web application to our Ubuntu Linux VM and configure it appropriately.

This project uses the following variables to store our app settings and database connection details.

Project variables

This episode's GitHub repo contains all the resources and links used in this video.

Wrap-up

We hope you enjoyed this episode as we have many more in the works! If there's a framework or technology you'd like us to explore, let us know in the comments.

Don't forget to subscribe to our YouTube channel as we're adding new videos regularly. Happy deployments! 😃