diff --git a/aspnetcore/fundamentals/configuration/index.md b/aspnetcore/fundamentals/configuration/index.md index 0829a31c74ff..7a76119de127 100644 --- a/aspnetcore/fundamentals/configuration/index.md +++ b/aspnetcore/fundamentals/configuration/index.md @@ -6,7 +6,7 @@ description: Learn how to use the Configuration API to configure app settings in monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 02/11/2026 +ms.date: 04/28/2026 uid: fundamentals/configuration/index --- # Configuration in ASP.NET Core @@ -641,7 +641,9 @@ For [Azure App Service](https://azure.microsoft.com/services/app-service/) app s ### Connection string prefixes -The Configuration API has special processing rules for four connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the following table are loaded into the app with the [default configuration](#default-app-configuration-sources) or when no prefix is supplied to . +The Configuration API has special processing rules for connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the following table are loaded into the app with the [default configuration](#default-app-configuration-sources) or when no prefix is supplied to . + +:::moniker range="< aspnetcore-10.0" Connection string prefix | Provider --- | --- @@ -662,6 +664,45 @@ Environment variable key | Converted configuration key | Provider configuration `SQLAZURECONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` `SQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` +:::moniker-end + +:::moniker range=">= aspnetcore-10.0" + +Connection string prefix | Provider +--- | --- +`APIHUBCONNSTR_` | Azure API hubs +`CUSTOMCONNSTR_` | Custom provider +`DOCDBCONNSTR_` | [Azure Cosmos DB](https://azure.microsoft.com/services/cosmos-db/) +`EVENTHUBCONNSTR_` | [Azure Event Hubs](https://azure.microsoft.com/services/event-hubs/) +`MYSQLCONNSTR_` | [MySQL](https://www.mysql.com/) +`NOTIFICATIONHUBCONNSTR_` | [Azure Notification Hubs](https://azure.microsoft.com/services/notification-hubs/) +`POSTGRESQLCONNSTR_` | [PostgreSQL](https://www.postgresql.org/) +`REDISCACHECONNSTR_` | [Azure Cache for Redis](https://azure.microsoft.com/services/cache/) +`SERVICEBUSCONNSTR_` | [Azure Service Bus](https://azure.microsoft.com/services/service-bus/) +`SQLAZURECONNSTR_` | [Azure SQL Database](https://azure.microsoft.com/services/sql-database/) +`SQLCONNSTR_` | [SQL Server](https://www.microsoft.com/sql-server/) + +When an environment variable is discovered and loaded into configuration with any of the prefixes shown in the preceding table: + +* The configuration key is created by removing the environment variable prefix and adding a configuration key section (`ConnectionStrings`). +* A new configuration key-value pair is created that represents the database connection provider, when a provider name is associated with the prefix. + +Environment variable key | Converted configuration key | Provider configuration entry + --- | --- | --- +`CUSTOMCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`MYSQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `MySql.Data.MySqlClient` +`SQLAZURECONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` +`SQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` +`POSTGRESQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `Npgsql` +`APIHUBCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`DOCDBCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`EVENTHUBCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`NOTIFICATIONHUBCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`REDISCACHECONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. +`SERVICEBUSCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Configuration entry not created. + +:::moniker-end + ## Command-line Using the [default configuration sources](#default-app-configuration-sources), the loads configuration from command-line argument key-value pairs after the following configuration sources: