Deploy ASP.NET Core App as Azure Containers Instances (ACI)

Microsoft has invested billions in Azure to drive technology and also hired best of the minds on this planet. From last few months, Azure has been launching new container-focused products and services on a regular basis. One of these products is Azure Container Instances. It acts as a bridge between platform as a service and infrastructure as a service architecture. Perhaps it would be okay to call this service as “Container as a Service”. Azure Container Instances (ACI) allows to rapidly create and launch containerized applications, without any overhead and with an easily scriptable set of commands. Designed to work both on its own and with tools like Kubernetes, ACI adds container-management commands to Azure, coupling them with a billing model that’s based on per-second usage, with no need to create and deploy (and pay for) container hosts. In this blog post, we’ll create an ASP.NET Core App, containerize it and deploy it as single instance on ACI.   Continue reading “Deploy ASP.NET Core App as Azure Containers Instances (ACI)”

ASP.NET Core App fails to start with error: ‘A path base can only be configured using IApplicationBuilder.UsePathBase().’

In one of the cases with setting up builds for new source code repositories we came across this issue. One of the microservices was written in ASP.NET core using Visual Studio. It was working fine using Visual Studio or when hosted using IIS, but it fails to start with below error when using dotnet native command inside docker image. The error message was like below:

System.InvalidOperationException: A path base can only be configured using IApplicationBuilder.UsePathBase().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Continue reading “ASP.NET Core App fails to start with error: ‘A path base can only be configured using IApplicationBuilder.UsePathBase().’”

Build ASP.NET Core Web App and deploy as Azure Web App on Containers

Azure Web Apps or Azure App Service Web Apps or simply Azure Websites is a PaaS service from Microsoft Azure which can be used to host web apps or APIs build using a variety of programming languages like ASP.NET, ASP.NET Core, Java, Ruby, PHP etc. It is also optimized for hosting web applications and containers, in case the SDK version required is not already supported by Web Apps. Rather than using ACS (Azure Container Services) and AKS (Azure Kubernetes Service), Azure Web Apps are more suitable for deploying long running containers. Also they become more affordable in terms of pricing as compared to the ACS and AKS. In this post, we’ll discuss how to create a very basic ASP.NET Core App and then deploy it as a container on Azure Web App.  Continue reading “Build ASP.NET Core Web App and deploy as Azure Web App on Containers”

Remove Docker Containers, Images, Volumes and Networks

Containerization has solved many issues related to traditional IT software. Docker and containers are almost synonymous as Docker makes it easy to wrap your applications and services in containers so you can run them anywhere. However as you work with Docker, you accumulate an excessive number of unused images, containers, and data volumes that clutter the output and consume disk space. Overtime it becomes necessary to clean up the clutter to claim disk space back and also prevent from disk getting full.

Fortunately, Docker has also certain inbuilt commands to clean up the system from the command line itself. This blog post aims to cover some of those commands that are useful for freeing disk space and keeping the system organized by removing unused Docker images, containers and volumes.
Continue reading “Remove Docker Containers, Images, Volumes and Networks”

Getting started with Windows Containers: In Practice

In previous blog post, we discussed what are windows containers, how they are different from Hyper-V containers and how they are beneficial to developers and sysadmins. We also discussed how Docker as a company has played an important part in the story. In this blog post, we will get quickly get started with installing windows containers and run our first container image by pulling it from docker registry.

Environment Pre-Requisites

  1. You must have a machine with Windows Server 2016 or Windows 10 installed on it. It may be a physical machine or the virtual machine. On the Sku side, you can have either DataCenter version or Standard version as well. Or you may also use Windows Server Core version.
  2. If its a virtual machine, make sure it has nested virtualization enabled.
  3. All windows updates should be installed on the machine.
  4. Administrative access to the machine.

Continue reading “Getting started with Windows Containers: In Practice”

Getting started with windows Containers : Covering Basics

Windows Server 2016 introduced a new feature called Containers. By installing this feature, you can run windows containers on your server. However, these are not Linux-based and they are not related to docker (as in docker software) as well. These containers run on Windows and run Windows on the inside. Also, These conform to the Open Container Initiative (OCI). They allow you to run applications insulated from the rest of the system, within portable containers that include everything an application needs to be fully functional.

The windows containers technology from Microsoft shares many similarities with its Linux counterpart. Both provide an isolated environment for running applications without affecting the rest of the system and without being affected by that system.
Continue reading “Getting started with windows Containers : Covering Basics”

Configure CI/CD for dockerized apps using VSTS and deploy to ACS

n this blog post, we’ll discuss how to configure CI/CD for dockerized apps using Visual Studio Team Services (VSTS) and deploy to a Linux based kubernetes cluster in Azure Container Services (ACS). For building dockerized app, we’ll use .NET core and build a linux based docker image. Also we’ll be using Azure Container Services to deploy Linux based Kubernetes cluster and Azure Container Registry for providing docker registry.

Deploy Kubernetes cluster on ACS

For this, please refer to this blog post here.

Deploy Azure Container Registry

Continue reading “Configure CI/CD for dockerized apps using VSTS and deploy to ACS”