• Stars
    star
    541
  • Rank 79,328 (Top 2 %)
  • Language
    C#
  • Created about 4 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is a demo with two ASP .NET 6 microservices using RabbitMQ and Docker

Microservice Series - From Zero to Hero

This repo is used for my 65 blog post series "Microservices - From Zero to Hero". It started out as .NET Core 3.1 project and has been upgraded to .NET 6 since then. The following tools and technologies are used:

  • .NET 6
  • Swagger
  • Asynchronous messaging using RabbitMQ and Azure Service Bus
  • Azure Functions
  • CI/CD YAML pipelines
  • Docker
  • Helm
  • Kubernetes
  • KEDA
  • AAD authentication

For more details, see the corresponding blog posts.

Getting Started with Microservices

The following posts explain the theory behind microservices and how to set up your first two .NET 6 (originally .NET Core 3.1) microservices. Both microservices use the mediator pattern and communicate via RabbitMQ.

Continuous Integration and Unit Tests in Azure DevOps

This section is all about automated builds using YAML pipelines in Azure DevOps. Starting with a simple .NET Core pipeline, the pipeline switches to building Docker images and then runs xUnit tests inside the Docker container. Another topic of this section is automated versioning of Docker images and lastly splitting up the pipeline into smaller chunks using templates.

Continuous Deployment with Azure DevOps

After building the Docker images, let's focus on deploying these images to Kubernetes. Each pull request gets deployed into a new namespace, SSL certificates, and a unique URL is generated and Helm is used to manage the deployment. Using Helm allows overriding configuration values. Furthermore, this section explains how to deploy Azure Functions, and SQL Databases and push NuGet packages to an internal or public feed.

Kubernetes with Helm

The following posts explain Microsoft's Azure Kubernetes Service and why Helm is useful for your deployments. After the basics, more advanced topics like Ingress controller, automated SSL certificate installation, and KEDA are discussed.

SSL Configuration in Kubernetes

Kubernetes helps to automatically create Let's Encrypt SSL certificates and Nginx as Ingress controller allows the creation of unique URLs for each microservice.

Create NuGet Packages

NuGet packages allow sharing of code between microservices. Additionally, the versioning of these packages gives developers full control over the version they are using and when they want to upgrade to newer versions.

Database Deployments with Azure DevOps

Deploying database changes has always been a pain. Using dacpac packages allows developers or database administrators to easily deploy their changes to an existing database, or create a new one with a pre-defined schema and optionally with test data. Docker also comes in handy when trying to deploy the dacpac package using Linux. Since Azure DevOps doesn't support deploying dacpacs on Linux, a custom Docker container is used to deploy the dacpac.

Azure Container Registry and Azure Service Bus

The Azure Container Registry is a private repository in Azure. Since it is private, Kubernetes needs an Image pull secret to be able to download images from there. Additionally, this section shows how to replace RabbitMQ with Azure Service Bus Queues and how to replace the .NET background process with Azure Functions to process messages in these queues.

Azure Functions

Azure Functions can be used to process messages from queues and can be deployed as a Docker container or as .NET 6 application.

Infrastructure as Code, Monitoring, and Logging

Infrastructure as Code (IaC) allows developers to define the infrastructure and all its dependencies as code. These configurations are often stored in YAML files and have the advantage that they can be checked into version control and also can be deployed quickly using Azure DevOps. Another aspect of operating a Kubernetes infrastructure is logging and monitoring with tools such as Loki or Prometheus.

Service Mesh

Big Kubernetes clusters can be hard to manage. Service Mesh like Istio helps administrators to manage Kubernetes clusters with topics such as SSL connections, monitoring, or tracing. All that can be achieved without any changes to the existing applications. Isitio also comes with a bunch of add-ons such as Grafana, Kiali, and Jaeger to help administrate the cluster.

KEDA - Kubernetes Event-Driven Autoscaling

Applications have become more and more complicated over the years and often rely on external dependencies these days. These dependencies could be an Azure Service Bus Queue or a database. KEDA allows applications to scale according to these dependencies.

AAD Authentication

Using Azure Active Directory authentication allows users to authenticate their applications using Azure identities. The advantage of this approach is that no passwords need to be stored and managed for the connection.

All Posts in Chronological Order

The following list consists of all blog posts in chronological order:

More Repositories

1

.NetCoreRepositoryAndUnitOfWorkPattern

This is a demo using the repository pattern in ASP.NET Core 3.1 with Entity Framework Core
C#
58
star
2

Azure-Solutions-Architect-Expert-notes

Notes for the AZ-303 and AZ-304 certification exam to gain the Azure Solutions Architect Expert certification
28
star
3

RepositoryAndUnitOfWorkPattern

Example implementation of the Repository and Unit of Work pattern in C#
C#
27
star
4

DecisionTree

Implementation of the ID3 to create a decision tree in C#. Also available import/export of training data and printing the tree
C#
13
star
5

.NetCore-DecoratorPattern

A demo implementation of the Decorator Pattern using ASP .Net Core 3.1
C#
11
star
6

MVC-Nlog

Demo for logging to a database with Nlog in ASP.NET Core MVC
HTML
9
star
7

TDD-Kata

A collection of TDD katas with C#, xUnit, xBehave, FluentAssertions and FakeItEasy
C#
6
star
8

ReadSecretsConsole

Demo on how to use Secrets in a .NET 6 console application.
C#
6
star
9

VisualStudioTemplate

Creating .Net Core Templates for Visual Studio
C#
3
star
10

ChainOfResponsibility

Example implementation of the chain of responsibility pattern in C#
C#
3
star
11

.NetCoreMicroserviceCiCdAks

This demo is outdated. For an up to date demo, see https://github.com/WolfgangOfner/MicroserviceDemo
C#
2
star
12

ConsoleDependencyInjection

Configure Dependency Injection for a .NET 5 Console Application
C#
2
star
13

AzureDevOpsGitCommit

Azure DevOps pipeline to commit files to a Git repository
2
star
14

AzureFunctions-CosmosDb

An Azure Function to get data from a Cosmos Database
C#
2
star
15

Uni-FlightRouteCalculator

Console application to calculate all possible flight routes between two cities, second assignment
C#
1
star
16

VisitorPattern

Example implementation of the visitor pattern in C#
C#
1
star
17

MVC-View-Components

Demo to demonstrate view components in ASP.NET Core MVC
C#
1
star
18

AdapterPattern

Example implementation of the adapter pattern in C#
C#
1
star
19

WithoutFacadePattern

Implementation of a salary calculation without the facade pattern in C#
C#
1
star
20

Azure-ChatBot-Return-Demo

Chat bot demo with the Azure Bot Framework showing different answer types
C#
1
star
21

LackierereiOfnerWebsite

JavaScript
1
star
22

TemplateMethodPattern

Example implementation of the template method pattern in C#
C#
1
star
23

Blazor-ServervsClient

A comparison between Blazor Server and WebAssembly
HTML
1
star
24

MVC-Core-Startup

Demo to explain the Startup class of ASP.NET Core MVC
HTML
1
star
25

FacadePattern

Example implementation of the facade pattern in C#
C#
1
star
26

StrategyPattern

Example implementation of the strategy pattern in C#
C#
1
star
27

.NetCore-ProxyPatterns

A demo for the Proxy Pattern in ASP .Net core 3.1 and GRPC
C#
1
star
28

React-Azure-Static-Web-App

React app which got deployed by Azure Static Web App
JavaScript
1
star
29

Azure-ServiceFabricDemo

An Azure Service Fabric Demo
C#
1
star
30

WithoutStrategyPattern

Implementation of a salary calculation without the strategy pattern in C#
C#
1
star
31

MVC-Core-Configure

Demo to show how to configure your ASP.NET Core MVC application
C#
1
star
32

MVC-ActionAndController

Showing how controllers and actions work and how to unit test them using xUnit
C#
1
star