Azure Kubernetes Service: Host ASP.NET Core 3.0 app in Docker Windows Server containers

Kubernetes has production level support for Windows nodes and Windows containers starting v1.14. The preview of Windows Server containers in Azure Kubernetes Service was announced recently and in this article I am going to share steps needed to run Windows containers in AKS.

  • Create a ASP.NET Core 3.0 (preview) application
  • Build and Publish Docker Image (Windows Server 2019)
  • Deploy ASP.NET Core 3.0 application to Windows nodes in Azure Kubernetes Service cluster

The dev tools used to develop these components are Visual Studio 2019/VS Code/Visual Studio for Mac, Docker for Windows (Docker CE) & Kubectl. AKS Dashboard as well as kubectl commands are used to create Kubernetes resources in AKS. The source code is available for download at GitHub.

Continue reading “Azure Kubernetes Service: Host ASP.NET Core 3.0 app in Docker Windows Server containers”

Configure Kubernetes Liveness and Readiness probes for ASP.NET Core 2.2 web application using Health checks

Health checks API is one of the new features of ASP.NET Core 2.2 for application health monitoring. Health checks are exposed by ASP.NET Core 2.2 application as HTTP endpoints which enables liveness and readiness probes.

Health checks are usually used with an external monitoring service or container orchestrator to check the status of an app. In this article, I am going to share steps needed to configure Kubernetes Liveness and Readiness probes for an ASP.NET Core 2.2 web application deployed in Azure Kubernetes Service cluster.

The dev tools used to develop these components are Visual Studio for Mac/Visual Studio 2017 and Visual Studio Code. AKS Dashboard as well as kubectl commands are used to create Kubernetes resources in AKS. The complete source code for this application can be downloaded from GitHub

Continue reading “Configure Kubernetes Liveness and Readiness probes for ASP.NET Core 2.2 web application using Health checks”

Deploy SonarQube to Azure Kubernetes Service cluster and integrate with Azure DevOps build pipeline

This is the next part of the series on developing and deploying

  • Angular, ASP.NET Core Web API and SQL Server to Azure Kubernetes Service
  • Function Apps using Azure Functions 2.0 runtime

In this article, I am going to share steps needed to deploy SonarQube to Azure Kubernetes Service cluster and integrate with Azure DevOps pipeline to setup code analysis for Angular and ASP.NET Core web apps created in previous parts of this series. The previous articles of this series are

Azure Kubernetes Service (AKS) – Deploying Angular, ASP.NET Core and SQL Server on Linux

ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets

Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)

Azure Functions 2.0: Create Function App from Docker Image (Functions triggered by Cosmos DB, Blob storage, Event Hub and SignalR service bindings)

Add real-time web functionality to Angular application using ASP.NET Core SignalR, Azure SignalR service and Azure SignalR Service bindings for Azure Functions 2.0

The tools used to develop these components are Visual Studio for Mac/VS Code/VS 2017, AKS Dashboard, Docker for Desktop and kubectl.

SonarQube

SonarQube provides the capability to not only show health of an application but also to highlight issues newly introduced. I am going to configure SQL Server as backend database for SonarQube.

Continue reading “Deploy SonarQube to Azure Kubernetes Service cluster and integrate with Azure DevOps build pipeline”

Add real-time web functionality to Angular application using ASP.NET Core SignalR, Azure SignalR service and Azure SignalR Service bindings for Azure Functions 2.0

This is the next part of the series on developing and deploying

  • Angular, ASP.NET Core Web API and SQL Server to Azure Kubernetes Service
  • Function Apps using Azure Functions 2.0 runtime

In this article I am going to go through steps needed to add real-time web functionality to Angular App using ASP.NET Core SignalR and Azure SignalR Service bindings for Azure Functions 2.0. The specific topics which this article is going to cover are

  • Add ASP.NET Core SignalR to ASP.NET Core 2.1 Web API
    • ASP.NET Core SignalR
    • ASP.NET Core SignalR scale out using
      • Azure SignalR Service backplane
      • Redis Cache backplane
  • Publish/Subscribe messages to SignalR Hub from Angular App
  • Publish/Subscribe messages to SignalR Hub using Azure SignalR Service bindings for Azure Functions 2.0 from Angular App
  • Build Docker images and deploy to Azure Kubernetes Service

The previous articles of this series are

Azure Kubernetes Service (AKS) – Deploying Angular, ASP.NET Core and SQL Server on Linux

ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets

Azure Functions 2.0: Create, debug and deploy to Azure Kubernetes Service (AKS)

Azure Functions 2.0: Create Function App from Docker Image (Functions triggered by Cosmos DB, Blob storage, Event Hub and SignalR service bindings)

The tools used to develop these components are Visual Studio for Mac/VS Code/VS 2017, AKS Dashboard, Docker for Desktop and kubectl.

Continue reading “Add real-time web functionality to Angular application using ASP.NET Core SignalR, Azure SignalR service and Azure SignalR Service bindings for Azure Functions 2.0”

ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets

This article is second part of the series on Deploying Angular, ASP.NET Core and SQL Server on Linux to Azure Kubernetes Service (AKS) cluster. The first part, describes steps needed to deploy these components to AKS. App configuration in ASP.NET Core is based on key-value pairs established by configuration providers. Configuration providers read configuration data into key-value pairs from a variety of configuration sources. In this article I am going to share multiple ways to load App configuration in ASP.net Core Web API

  • Hosting Environment specific appsettings.json
  • Dockerfile Environment Variables
  • Kubernetes
    • Container Environment variables with data from ConfigMap/Secret
    • Populate Volume (Config file) with data stored in a ConfigMap/Secret
  • Azure Key Vault Secrets

The tools used to develop these components are Visual Studio for Mac/VS Code/VS 2017, AKS Dashboard, Docker for Desktop and kubectl. The formatting of code snippets in this article may get distorted (especially yaml), thus please refer to GitHub repository for complete source code for this article.

Continue reading “ASP.NET Core 2.1 Web API – Load App Configuration from appsettings.json, Dockerfile environment variables, Azure Key Vault Secrets and Kubernetes ConfigMaps/Secrets”

Azure Dev Spaces – Debug Containers directly in Azure Kubernetes Service (AKS) from Visual Studio 2017

This is second part of the series on Azure Dev Spaces. The first part of this services describes steps needed to deploy Angular App and ASP.net Core Web API to AKS using Azure Dev Spaces. This article will show ease of debugging containers deployed in AKS from Visual Studio 2017.

In the first part of this series, I had created a sample ASP.net Core Web API app and deployed that to AKS using Azure Dev Spaces. The steps needed to debug ASP.net Core Web API application running in AKS are

  • Install Visual Studio Tools for Kubernetes. Once installation completes, open ‘Tools -> Extensions and Updates’ in Visual Studio and update this extension for any updates.
  • Open SampleWebApp solution in Visual Studio. The source code can be downloaded from GitHub.
  • Select Debug target as Azure Dev Spaces

  • Add a breakpoint in Get method of UsersController which we are going to debug
  • Start Debugging and select AKS cluster and Space in Azure Dev Spaces prompt
  • You can get public URL from Output window by selecting Azure Dev Spaces as displayed below
  • Open http://{URL}/api/users in browser and request will hit the breakpoint added previously

You can check the status of URL by running command azds list-uris. If URL isn’t available for more than 5 minutes you will need to delete PODS as explained in previous article. This completes this article which showed how easy it is to debug containers deployed in AKS from Visual Studio 2017 using Azure Dev Spaces.