Prevent .NET Application Insights telemetry loss

If you’re using the .NET Application Insights SDK to instrument and monitor your ASP.NET Core or worker service applications, this blog post is for you. We’ll explore some potential causes for data loss in your telemetry, and how to fix them:

Continue reading “Prevent .NET Application Insights telemetry loss”

Modern minimal workers in .NET

Since the release of .NET 6, we’ve heard a lot about ASP.NET Core minimal APIs. They’ve been discussed at Microsoft conferences, in blog posts, in YouTube videos, and on social networks. We’ve all seen this kind of code sample of a minimal API:

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

This is significantly more concise than controller-based web APIs, and we can all agree on that. But did you know that since the release of .NET 7, there is also a way to create minimal workers?

Continue reading “Modern minimal workers in .NET”

Generate a custom C# ChatGPT API client in minutes with Kiota

During my recent visit to the Microsoft offices in Montréal for a meetup organized by the MSDEVMTL Meetup group, I had the opportunity to learn more about Kiota, an incredible tool developed by Microsoft. The Kiota development team showcased its capabilities and demonstrated how it streamlines the process of generating client SDKs for various APIs.

Kiota is an OpenAPI-driven code generation tool that enables developers to create SDKs in different programming languages. By using Kiota, you can generate a custom C# client for a given API, tailored to your specific needs. This is an alternative to using third-party packages, as it allows for greater flexibility and control over your implementation.

In this blog post, we will dive into the process of generating a C# client for the ChatGPT API using Kiota, and explore the benefits of having a custom SDK at your disposal instead of third-party NuGet packages developed by the community.

Continue reading “Generate a custom C# ChatGPT API client in minutes with Kiota”

Speeding up DefaultAzureCredential authentication in local development with Azure CLI

If you’re developing .NET applications that integrate with Microsoft Azure resources, such as Key Vault, you’re probably familiar with the DefaultAzureCredential class from the Azure.Identity library. This class simplifies the process of authenticating against Azure services by providing a unified way to retrieve access tokens. However, when working in a local development environment, you might have noticed that DefaultAzureCredential can take up to 10 seconds to retrieve your Azure CLI credentials, impacting your productivity. In this blog post, we’ll explore two ways to speed up this process: using DefaultAzureCredentialOptions and ChainedTokenCredential.

Continue reading “Speeding up DefaultAzureCredential authentication in local development with Azure CLI”

Take your .NET configuration to the next level with value substitution

Configuration in .NET is a powerful pattern that allows .NET developers to manage application settings from various sources, such as JSON files, environment variables, and more. However, sometimes developers need a way to reference and substitute configuration values from other settings, which is not provided out of the box. That’s where the GSoft.Extensions.Configuration.Substitution library comes in!

In this blog post, we will explore how the GSoft.Extensions.Configuration.Substitution library works, its benefits, and how to get started with it.

Continue reading “Take your .NET configuration to the next level with value substitution”