Configuration

Week 3, 2022 - Tips I learned this week

Tooling around .NET, Azure DevOps, and VS Code.

.NET 6 introduced a new way to build a .NET application using the new WebApplication and WebApplicationBuilder classes. One thing I like about it is how configuration is handled. Instead of using the ConfigureAppConfiguration method to add a new configuration source, you can directly use the Configuration property on the WebApplicationBuilder instance. You can see an example of this change on this screenshot of the ASP.NET Core documentation:

Read more...

ASP.NET Core - Lost in configuration

How should you use configuration providers in ASP.NET Core?

Have you ever felt a bit overwhelmed by the configuration in a project, not knowing where to look for the settings between the command line parameters, the environment variables, the configuration files in code, the configuration in Azure, ... ? When developing an ASP.NET Core application there are many places where you can put your configuration which makes it difficult to know where you should put it. Even if the official documentation about configuration in ASP.NET Core is very complete and well written, it only describes what you can use and how to use it, not what you should use and when. In this article, I will try to answer these questions and give you my opinion about how we should use configuration providers in ASP.NET Core.

Read more...

You almost no longer need Key Vault references for Azure Functions.

Talking about how to manage configuration secrets in Azure Functions.

The possibility to add configuration sources in Azure Functions has just been released with the latest version of Microsoft.Azure.Functions.Extensions NuGet package. I have been waiting for this feature for a long time (like many people I think) because it brings to Azure Functions all the things we are used to with configuration in ASP.NET Core 😻. But that is not the only reason, it is also because with this feature you almost don't need to use key vault references!

Read more...