Skip to content

EnvironmentVariablesConfigurationProvider not load connection string prefix POSTGRESQLCONNSTR_ on Azure AppService #57545

Closed

Description

@thohng

Description

On Azure AppService, it is able to add connection string for PostgreSQL. But the configuration does not load the PostgreSQL connection string. The workaround is select 'Custom' when adding connection string instead of 'PostgreSQL' provider.

Configuration

Setup PostgreSQL connection string on Azure AppService
image

Checking Azure AppService Environments
image

Other information

Latest code on repository:

private const string MySqlServerPrefix = "MYSQLCONNSTR_";
private const string SqlAzureServerPrefix = "SQLAZURECONNSTR_";
private const string SqlServerPrefix = "SQLCONNSTR_";
private const string CustomPrefix = "CUSTOMCONNSTR_";
private readonly string _prefix;

public class EnvironmentVariablesConfigurationProvider : ConfigurationProvider
{
	private const string MySqlServerPrefix = "MYSQLCONNSTR_";
	private const string SqlAzureServerPrefix = "SQLAZURECONNSTR_";
	private const string SqlServerPrefix = "SQLCONNSTR_";
	private const string CustomPrefix = "CUSTOMCONNSTR_";

	private readonly string _prefix;

Activity

  1. ghost added
    untriaged
    on Aug 17, 2021
  2. ghost added
    in-pr
    on Aug 17, 2021
  3. thohng commented on Aug 17, 2021

    @thohng
    Author

    Related document of Azure AppService / Configure connection strings

    https://docs.microsoft.com/en-us/azure/app-service/configure-common#configure-connection-strings

    At runtime, connection strings are available as environment variables, prefixed with the following connection types:
    
    SQLServer: SQLCONNSTR_
    MySQL: MYSQLCONNSTR_
    SQLAzure: SQLAZURECONNSTR_
    Custom: CUSTOMCONNSTR_
    PostgreSQL: POSTGRESQLCONNSTR_
    
  4. davidfowl commented on Aug 17, 2021

    @davidfowl
    Member

    We should just add it.

  5. removed
    untriaged
    on Aug 18, 2021
  6. added this to the 7.0.0 milestone on Aug 18, 2021
  7. ghost removed
    in-pr
    on Nov 24, 2021
  8. thohng commented on Nov 25, 2021

    @thohng
    Author

    The issue is not fixed

  9. ghost locked as resolved and limited conversation to collaborators on Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions