Skip to main content

Posts

.NET 9–OpenAPI and Scalar–Passing an API key

Let's continue our joruney in discovering Scalar . Today I want to talk about how we can integrate security. Most API's that we build today are secured in a way. This could be as simple as an API key or as complex as using OAuth with PKCE. In this post we’ll look at how to pass an API key through the Scalar UI. Let’s dive in… I assume that you already have registered an authentication scheme for your API like this: Now we need to write an extra transformer to include the authentication information in our OpenAPI metadata. Don’t forget to register this transformer in our OpenAPI configuration: At the Scalar level we don’t have to change anything: But if we now browse to the Scalar UI, the authentication scheme is recognized and we get the option to pass an API key:   Nice! More information .NET 9–OpenAPI and Scalar–Introduction .NET 9–OpenAPI and Scalar–Adding custom headers

Get an overview of task duration of Windows Scheduled Tasks

A long time ago, we made the decision to implement some features using batch processes that were scheduled to run at night (most of them as scheduled tasks). Over time the list of batch processes has further grown, with 85 processes running almost every night today. A sad record... Our business has further evolved and were it originally made sense to schedule all this work outside the regular business hours, we now encounter the following issues: The list of remaining free time slots is getting smaller and smaller, making it almost impossible to schedule a new task without interfering with other tasks. As our datasets have grown over the years, these processes typically also take longer and longer to execute. Our customers are interacting with our services more and more outside the regular business hours. It is no longer acceptable for our business to have to wait for some data. Realtime info is key to take correct business decisions. Some of these batch processes ar...

Generate Terraform configuration files from your Azure resources

While everyone is focusing all the announcements at Build 2025, I'm still processing some of the older recently announced features. A feature that I am happy that is finally available in preview is the Terraform export functionality in the Azure Portal. A similar feature already exists for some time for ARM and Bicep but now we can finally export to Terraform configuration files as well. Let’s give it a try… A short walkthrough Go to the Azure portal and browse to a specific resource. From there go to the Automation section and click on Export template . Click on the Terraform tab. The first time I did this I got the error below:   The reason is that you first need to register the Microsoft.AzureTerraform resource provider at the subscription level. Go to your Subscription in Azure. There open the list of Resource Providers .   Search for Microsoft.AzureTerraform resource provider and click on Register .   It can take some ...

The (non) sense of organization charts

Today while explaining my son how our heating system works, it brought me back to my earlier post about organization charts. Same as in heating system where you have a heating loop and a control loop, 2 loops exist in every organization. The first is formal and visible—it's drawn out in neat boxes and lines as your organizational chart, showing who reports to whom and where decisions get made. The second is informal and largely invisible—it's the actual pathways through which information, ideas, and real work flow to get things done. The two flows of organizational systems When we apply systems thinking to organizations, we can identify two critical flows that determine how effectively an organization functions: Control flow represents the formal authority structure—who has decision-making power, who approves what, and how accountability flows up and down the hierarchy. This is what your org chart captures beautifully with its clean boxes and reporting lines. Informat...

.NET 9–OpenAPI and Scalar–Adding custom headers

In this post I continue my investigation of using Scalar as an alternative to Swashbuckle that I was using before to expose my OpenAPI metadata in a userfriendly way. If you have no idea what Scalar is, I would recommend to check out my introduction post first before you continue reading. Today I want to have a look at how we can transform the OpenAPI metadata. On this specific API, it is expected that one of a set of custom headers is passed when calling the API. To simplify the experience, I originally created  an IOperationFilter for Swashbuckle to show these extra headers: How to customize the OpenAPI metadata in .NET 9? The generated OpenAPI document can be customized using “transformers”, which can operate on the entire document, on operations, or on schemas. Transformers are classes that implement the IOpenApiDocumentTransformer , IOpenApiOperationTransformer , or IOpenApiSchemaTransformer interfaces. Each of these interfaces has a single async method that receives...

The servant leadership paradox - When org charts contradict culture

In boardrooms and mission statements across the globe, "servant leadership" has become the philosophy du jour. Leaders proudly proclaim their commitment to serving their teams, inverting the traditional power structure, and putting employees first. Yet something curious happens when you ask to see their organizational charts. There they are—the familiar pyramids with executives perched at the top, managers in the middle, and the frontline workers—those actually creating value—relegated to the bottom or, in many cases, not represented at all. This visual contradiction begs the question: Can an organization truly embody servant leadership when its very structure portrays the opposite relationship? The telling power of visuals I think that organizational charts are more than administrative tools—they're powerful symbols that communicate "how things really work around here." When leadership teams espouse servant leadership while maintaining traditional hiera...

.NET 9–OpenAPI and Scalar–Introduction

With the release of .NET 9 , Microsoft has removed Swashbuckle from the default Web API templates. If you have never heard about Swashbuckle before, it allowed you to generate OpenAPI metadata for your web api's. Although I had no complaints using the Swagger UI, I decided to use the opportunity to have a look at library, Scalar, to generate an UI based on the OpenAPI documentation. In this post, I’ll walk you through my transition from Swashbuckle to Scalar, highlighting the benefits, challenges, and key implementation steps. Why the change? Microsoft decided to drop Swashbuckle due to maintenance issues and a shift toward integrated OpenAPI support . While Swashbuckle provided automatic documentation , Swagger UI integration , and customizability , Scalar introduces a sleek UI , mobile-friendly interface , and enhanced search capabilities . Scalar not only provides great integration for .NET but also works on a lot of other platforms. Setting Up Scalar in .NET 9 To i...