Skip to content

Initializing a connection string from an app service environment variable #246

Description

@Jordan-Justice

Hello. I've been trying to configure the applicationinsights serilog sink using appsettings and ReadFrom.Configuration(). However my app has run into a problem after I deploy to azure.

The readme states

A connectionString can be omitted if it's supplied in the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable.

I have this environment variable configured on my app service, but Azure prefixes the environment variable name with APPSETTINGS_. Which means the environment variable my web api receives is APPSETTINGS_APPLICATIONINSIGHTS_CONNECTION_STRING and the application insights sink fails to initialize with a connection string as a result.

Have you guys encountered this scenario before? Do you have any advice for how to navigate it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions