Skip to main content

Posts

Kubernetes–Setup a local cluster through Podman Desktop

Running a local Kubernetes cluster is easy thanks to Podman Desktop and Kind . In this post I show you how to setup a kind environment from Podman Desktop. But first an introduction… What is Podman Desktop? Podman Desktop is an open source graphical tool enabling you to seamlessly work with containers and Kubernetes from your local environment. It offers similar functionality as Docker Desktop. Installing Podman Desktop(on Windows) is easy: Download the Windows installer . Start the Podman Desktop installer, open the downloaded file. Podman Desktop uses WSL2 to run a a Linux distribution in a virtual machine. It can be that a restart is required as the installer will try to enable/install WSL2 during the process. More information: Windows | Podman Desktop (podman-desktop.io) What is Kind? Kind is an open source project that allows to run Kubernetes clusters in a container engine (could be Docker or Podman or others). This is usually quite he
Recent posts

.NET Core - Renew localhost certificate

Today when I tried to debug a .NET Core application, I got a browser warning that my localhost certificate was no longer valid. The good news is that renewing your localhost certficate when using Kestrel is easy. You can use the built-in dotnet dev-certs command to manage a self-signed certificate. We can first remove the existing outdated certificate by executing the following command: dotnet dev-certs https --clean Output: Cleaning HTTPS development certificates from the machine. A prompt might get displayed to confirm the removal of some of the certificates. HTTPS development certificates successfully removed from the machine. Now we can generate a new self-signed certificate using following command: dotnet dev-certs https –trust Output: Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate. Successfully created and truste

.NET Core - View outdated packages

When creating and maintaining (.NET Core) applications, it is always a good idea to keep the dependencies up-to-date. This helps to fix identified vulnerabilities but also keeps the upgrade path short as you closely stay to the latest package version. In this post I show you 3 ways to identify outdated packages and update them when necessary. Through the Visual Studio Package Manager When using Visual Studio, it is easy to find out whether newer versions of the NuGet packages used by your project is available, by using the NuGet Package Manager: Open your solution/project in Visual Studio Go to Tools -> NuGet Package Manager –> Manage NuGet Packages for Solution… Go to the Updates tab, check the Select all packages checkbox and click on Update Through the dotnet-outdated global tool A second option is to use the open source global .NET tool: dotnet-outdated . First install the tool using the following command: dotnet tool install --global dotnet-

The biggest effect on code quality

You carefully assembled a team of great developers, a top architect, UX designers, product owners, etc… You are confident that with this team you can tackle any challenge. However after 2 years working on the project, you have lost a lot of this confidence. The list of requested features keeps growing, existing functionality needs to be reworked because the business needs have evolved, and people work longer and longer days to still reach the predicted deadline. What started as workarounds to reach the end goal faster has evolved to just work. Workarounds are no longer the exception but became the rule. The solution becomes less and less stable and bugs are appearing everywhere. What is going on? Aha, we just discovered the biggest impact on code quality. It is not the skills of the team, neither the programming language or technologies they use, it is something else. The answer is ‘avoiding crunch mode’. Crunch mode , also known as crunch time , describes working extra

Azure Static Web App–Data API Builder

As a follow-up on the presentation I did at CloudBrew about Azure Static Web Apps I want to write a series of blog posts. Part I - Using the VS Code Extension Part II - Using the Astro Static Site Generator Part III  – Deploying to multiple environments Part IV – Password protect your environments Part V – Traffic splitting Part VI – Authentication using pre-configured providers Part VII – Application configuration using staticwebapp.config.json Part VIII – API Configuration Part IX – Injecting snippets Part X – Custom authentication Part XI – Authorization Part XII -  Assign roles through an Azure function Part XIII -  API integration Part XIV – Bring your own API Part XV – Pass authentication info to your linked API Part XVI – Distributed Functions Part XVII(this post) – Data API Builder So far I have shown you 2 different possibilities to integrate an API inside your Azure Static Web App: You have the Mana

.NET 8 - Warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteHandlers.RouteHandlerAnalyzer' threw an exception of type 'System.InvalidOperationException'

After upgrading an application to .NET 8, the following warning appeared inside my IDE: Warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteHandlers.RouteHandlerAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Failed to resolve well-known type 'Microsoft.AspNetCore.Builde r.EndpointRouteBuilderExtensions'.'. As I have the ‘Treat Warnings as Errors’ setting enabled by default, this was a blocking issue for me. The problem is caused by a Roslyn lookup inside the RouterAnalyzer which searches for the EndpointRouteBuilderExtensions class by using GetTypeByMetadataName . However as HotChocolate is using exactly the same class name and namespace, null is returned  instead of the correct type.  This issue not only happens when using HotChocolate but also with the AspNetCore.HealthCheck.UI package that also has an EndpointRouterBuilderExtension class: AspNetCore.Diagnostics.HealthChecks/src/Health

ASP.NET Core -Updating the OpenTelemetry configuration

Today I had to make some changes to an existing ASP.NET Core application still using .NET 6 and a preview version of the OpenTelemetry.Extensions.Hosting nuget package. I thought it was a good time to update to .NET 8 and to the latest OpenTelemetry version so updated both the targetframework and the used package versions. After the changes my csproj file looked like this: However when I tried to compile and run my application I got the following error message: 'IServiceCollection' does not contain a definition for 'AddOpenTelemetryTracing' and no accessible extension method 'AddOpenTelemetryTracing' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) Here is the code that caused the error: Turns out that the OpenTelemetry API has changed quite significantly since the preview and that AddOpenTelemetryTracing has been removed in favour of AddOpenTelemetry sinc