Category: ASP.NET Core

ASP.NET CoreKubernetes

Azure Kubernetes Service First Look

I’ve read a fair bit about Kubernetes over the last couple of years but never got around to having a proper hands on go at running applications in a Kubernetes cluster. Most of my cloud development has been on AWS however my workplace for the past almost 2 years has been on Azure so decided to give AKS a go.

My approach to getting a proper feel was to have a couple of very simple applications hosted on AKS with typical application requirements such as exposing an API to the public internet with custom DNS, TLS termination, some type of application secret management, pub/sub via an API call and a worker subscribing to the published message etc.

You can find the source code here on Github with complete steps on getting the solution running on AKS.

The solution includes two .NET Core 3.0 applications, an API and a background worker process, intentionally kept very simple.

The ASP.NET Core 3.0 API provides a few endpoints:
1. GET /env which returns the machine / pod name that the API is running on.
2. GET /secrets which returns all the applications secrets
3. POST /command which sends a message to Azure Service Bus using NServiceBus

The .NET Core 3.0 worker process subscribes to the message sent by the /command API endpoint and simply does a console.writeline on the message body.

The solution uses Azure Active Directory Pod Identity to assign User Managed Identities to pods allowing access to Azure resources. The application’s in the solution use two different types of Azure resources, Azure KeyVault and Azure Service Bus. The reason why I chose KeyVault for secret management was that it by default provides encryption at rest and is easily configured to provide auditing and soft deletes.


ASP.NET Core Real-time Performance Monitoring

Update: Based on App Metrics 1.0, latest documentation can be found here

One of my previous posts was about open source application performance management, and why we even consider open source. If we were to give an open source monitoring solution a shot for an ASP.NET Core application, what options are available? One option is an open source project I’ve been working on, App Metrics. It targets .NET Standard which of course makes it a cross platform solution, provides various extensions allowing metrics to be captured in process and persisted to several TSDBs, as well as providing application health checks.

Read More


ASP.NET Core Health Checks

Update: Based on App Metrics 1.0, latest documentation can be found here

Health checks are useful to not only test the internal health of your application but also it’s external dependencies such as confirming that a third party api is available or confirming the connectivity to a database for example. App Metrics provides such health checks and exposes a health endpoint whereby results can be viewed and monitored. Health checks in App Metrics are small tests which return either a healthy, degraded or unhealthy result. Health checks are executed when the health endpoint is requested via ASP.NET Core Middleware.

Here we’ll look at configuring App Metrics to provide health checks in an ASP.NET Core MVC application.

Read More