Using Azure App Configuration in ASP.NET Core
In this section, we will learn how we can use Azure App Configuration in ASP.NET Core. For the purposes of learning, we will be reading the database connection string created in the last section from Azure App Configuration. In this section, we are using the dotnet CLI to create the project and VS Code to develop and debug. You can use VS as well. Here are the steps we will follow:
- First, we will be creating an ASP.NET Core Web API project using the
dotnet new webapi -minimal -o Chapter09 --framework
net6.0
command. - Next, we need to add the Microsoft.Azure.AppConfiguration.AspNetCore NuGet packages to connect with Azure App Configuration and read the
ApiEndpoint
key from the configuration store. From thecommandline
orterminal
, execute thecd Chapter09
command, and then execute thedotnet add package
Microsoft.Azure.AppConfiguration.AspNetCore
command. - Now, we can open the project in VS Code in the same terminal window...