Azure Securing Web APIs with Azure AD: Designing Authentication Schemes Posts in this series: * A Case Study * Designing Authentication Schemes * Authorizing Client Applications * Building the Server * Enabling Local Development * Connecting External Clients * Connecting Azure Clients Full example In our last post, I walked through my real-world scenario of needing to follow Zero Trust principles in securing microservice-based APIs inside (and
Azure Securing Web APIs with Azure AD: A Case Study Posts in this series: * A Case Study * Designing Authentication Schemes * Authorizing Client Applications * Building the Server * Enabling Local Development * Connecting External Clients * Connecting Azure Clients Full example Recently, I was on a project where the company had a big push towards a "Zero Trust" security model. This concept
Azure Building Messaging Endpoints in Azure: Container Apps Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps Well it's been a while since we visited this! I intended to follow up with a post on Kubernetes but to be honest, Kubernetes is far too complicated
MediatR You Probably Don't Need to Worry About MediatR I've been pointed at this post from various sources, and I thought I'd take the time to address the criticisms one by one. Not because I personally care too much, MediatR evolved over many years to solve the problems my teams faced, but since others seem
AutoMapper Dissecting AutoMapper Programming Horror My AutoMapper search alerts brought me this gem this morning: Hey... let's use automapper to generate passwords. This post illustrates basically all the wrong reasons to use AutoMapper. Here's the code minus the unimportant bits: public class RequestProfile : Profile { public RequestProfile() { CreateMap<Request, NewAccount>
NServiceBus NServiceBus.Extensions.Diagnostics 2.1 Released From the previous post on building NServiceBus metrics, I've pushed a new version of the NServiceBus.Extensions.Diagnostics and OpenTelemetry packages: * NServiceBus.Extensions.Diagnostics NuGet * NServiceBus.Extensions.Diagnostics ReadMe * NServiceBus.Extensions.Diagnostics.OpenTelemetry NuGet * NServiceBus.Extensions.Diagnostics.OpenTelemetry ReadMe As before, the OpenTelemetry packages are just small wrappers
Distributed Systems Building NServiceBus Metrics with OpenTelemetry and System.Diagnostics.Metrics The release of System.Diagnostics.DiagnosticSource version 6.0 a few months back brought something entirely new to the library - support for OpenTelemetry Metrics. Since this package releases out-of-band from the .NET 6 SDK, it also means you can use these new metrics APIs in any application targeting .NET
Microservices Activity Enrichment in ASP.NET Core 6.0 Waaaaay back in the ASP.NET Core 3.1 days, I wrote about increasing the cardinality of traces using Tags and Baggage. You could write code in your controllers, filters, or application code to be able to add custom information to traces to help find these traces more effectively: [HttpGet]
NServiceBus.Extensions.Diagnostics 2.0 Released Last week I pushed out the 2.0 release of NServiceBus.Extensions.Diagnostics package: * NuGet * Release Notes And related packages: * NServiceBus.Extensions.Diagnostics.OpenTelemetry * NServiceBus.Extensions.IntegrationTesting The biggest feature change was to allow behaviors to be able to modify the original activity started by accessing an ICurrentActivity from the
MediatR Diagnosing and Fixing MediatR Container Issues An issue I see come up quite frequently, much to the chagrin of DI container maintainers, are problems of complex generics edge cases and how they come up in MediatR. In fact, more than one container author has demanded some kind of recompense for the questions received and issues opened
Design Patterns Service Locator is not an Anti-Pattern Well, it is, sometimes. It depends. I often get pushback on MediatR for using service location for resolving handlers, often getting pointed at Mark Seemann's post that Service Locator is an Anti-Pattern. And for all of the examples in the post, I agree that service location in those
Contoso University Vertical Slice example updated to .NET 6 As the title states, I updated the Vertical Slice example from .NET 5 to 6, migrating away from Startup, updating packages and in general updating to C# 10: Contoso University - Vertical Slices Enjoy!
MediatR MediatR 10.0 Released MediatR 10.0.0 released today: * Release notes * Migration Guide * MediatR.Extensions.Microsoft.DependencyInjection release notes * NuGet This release adds support for IAsyncEnumerable<T> with separate types for this separate kind of request/response: * IStreamRequest<TResponse> * IStreamRequestHandler<in TRequest, TResponse> * IStreamPipelineBehavior<in TRequest,
AutoMapper AutoMapper 11.0.0 released As the title says, I pushed AutoMapper 11.0.0 today: * Release notes * NuGet * 11.0 Upgrade Guide This is somewhat of a minor release but some API changes forced a major version bump. Also, starting with this version, AutoMapper drops support for full .NET framework, as this release targets
Domain Driven Design Domain-Driven Refactoring: Encapsulating Collections Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections In the last post, we looked at refactoring our domain model so that we have explicit entry points in order to mutate our domain object. I skipped one of
Domain Driven Design Domain-Driven Refactoring: Encapsulating Data Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections In the last post, we looked at using a few common refactorings to encapsulate operations and push behavior down into our domain model. While this works to encapsulate operations,
Domain Driven Design Domain-Driven Refactoring: Defactoring and Pushing Behavior Down Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections In the last post, we looked at our procedural handler and pulled behavior out that called to external services into its own domain service. This let our handler become
Domain Driven Design Domain-Driven Refactoring: Extracting Domain Services Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections In my last post, we looked at the Compose Method refactoring as a means of breaking up long methods into smaller ones, each with an equivalent level of granularity.
Domain Driven Design Domain-Driven Refactoring: Long Methods Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections In the last post, I walked through the main, immediate code smell we saw of a long method, and I would classify this method as long: public class AssignOfferHandler
Domain Driven Design Domain-Driven Refactoring: Procedural Beginnings Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections As part of the red-green-refactor TDD process, the second step of making the test pass means we write the simplest (but still correct) code that can possibly work that
Domain Driven Design Domain-Driven Refactoring: Intro Posts in this series: * Intro * Procedural Beginnings * Long Methods * Extracting Domain Services * Defactoring and Pushing Behavior Down * Encapsulating Data * Encapsulating Collections A common theme in domain-driven design are design patterns. When you start learning about DDD, you'll be presented with many code-level concepts such as: * Aggregates * Entities * Value
Azure Local Development with Azure Service Bus For teams new to Azure Service Bus, one of the first questions you have to answer is "how do I develop against this?" And it turns out the answer isn't that straightforward - because it's currently impossible to run Azure Service Bus outside of
Docker Taming the WSL 2 Resource Monster I've switched all of my Docker and *nix usage to use WSL 2 for a while now, and largely have been free of any issues/problems. That is, until recently, when I've been working on speeding up my team's production Docker image builds (another
CSharp Crossing the Generics Divide Generics are great, until they aren't, and when they aren't is when you don't know the type at compile-time but at runtime. This isn't necessarily a bad thing, and isn't necessarily a design problem. Remember, void Main is not generic,