Skip to content

ConnectionStrings

Tore Nestenius edited this page Nov 22, 2024 · 1 revision

Connection Strings Tool

Overview

This tool lists all connection strings detected by ASP.NET Core. The connection strings may come from configuration files, environment variables, or other sources available to the application's configuration system.

Purpose

The tool helps you:

  • Verify that the connection strings are configured in your application.
  • Check how connection strings are exposed through the ConnectionStrings section in ASP.NET Core.
  • Understand the limitations of connection string mapping in Azure App Service.

How It Works

  1. The tool retrieves all entries under the ConnectionStrings section from the ASP.NET Core configuration system.
  2. It displays the connection string names and values in a tabular format.
  3. The tool specifically highlights connection strings that Azure App Service maps to the ConnectionStrings section, such as:
    • MySQL
    • SQL Azure
    • SQL Server
    • Custom

Other connection strings (e.g., RedisCache, ServiceBus) are not automatically mapped to the ConnectionStrings section and must be accessed via environment variables.


Important Notes

  • Only the following connection string types defined in Azure App Service are displayed in the ConnectionStrings section:
    • MySQL
    • SQL Azure
    • SQL Server
    • Custom
  • Other types, such as RedisCache, NotificationHub, and ServiceBus, are available only as environment variables.

To access connection strings not listed in the ConnectionStrings section, retrieve them using the appropriate environment variable names. For example:

var redisConnectionString = Environment.GetEnvironmentVariable("REDISCACHECONNSTR_conn10");
Clone this wiki locally