You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bind all properties of ApplicationInsightsServiceOptions from IConfiguration. Currently, InstrumentationKey, ConnectionString, DeveloperMode and EndpointAddress are the only properties which gets bound to ApplicationInsightsServiceOptions from configuration.
Application Insights special environment variables
Configuration providers that are added later override previous key settings. For example, if InstrumentationKey is set in both appsettings.json and the environment variable, the environment variable value is used. Application Insights special environment variables configuration provider, overrides values from all other providers.
If a key and value is set in more than one configuration providers, the value from the last provider added is used.
What are the names of special Application Insights Environment Variables? APPINSIGHTS_INSTRUMENTATIONKEY, APPLICATIONINSIGHTS_CONNECTION_STRING, APPINSIGHTS_DEVELOPER_MODE, APPINSIGHTS_ENDPOINTADDRESS
Which application insights properties are supported through configuration file?. InstrumentationKey, ConnectionString, DeveloperMode and EndpointAddress
What happens if additional properties like EnableAdaptiveSampling, EnableHeartbeat are present in ASP.NET Core Configuration?
Application Insights will not read these properties and will not be used when tracking an app.
Is there a workaround to read other application insights properties defined in ApplicationInsightsServiceOptions through ASP.NET Core Configuration Providers?
Please refer #1806 for workaround.
Read all properties defined in ApplicationInsightsServiceOptions from any ASP.NET Core Configuration Providers.
By default, read values from IConfiguration used within an application. A call to services.AddApplicationInsightsTelemetry() will read properties from any custom configuration providers like JSON file, XML file, Azure Key Vault, etc.,
Which ASP.NET Core Configuration providers will be supported?
All Configuration supported with ASP.NET Core Framework.
appSettings.json
appsettings.Environment.json
An existing IConfiguration from app – this enables reading from any configuration providers
Environmental variables
Application Insights special environment variables
Is the new configuration model supported in all versions of .NET Framework?
No. These changes will be available to .NET Core apps that target NET461, NETSTANDARD2.0 or higher versions.
A .NET Core app is targeting NET46, would these changes impact that app?
There are no impact with these changes to apps targeting old version of .NET Framework. It should continue to work in the same way as defined in current behavior section.
The text was updated successfully, but these errors were encountered:
cijothomas
changed the title
Read all properties of ApplicationInsightsServiceOptions from IConfiguration
Automatically read all properties of ApplicationInsightsServiceOptions from IConfiguration
Sep 15, 2020
Summary
ApplicationInsightsServiceOptions
from IConfiguration. Currently,InstrumentationKey
,ConnectionString
,DeveloperMode
andEndpointAddress
are the only properties which gets bound toApplicationInsightsServiceOptions
from configuration.Related Issues:
Api hosted in service fabric can not pickup config #1566
Custom ConfigurationProviders are not respected #1297
Which settings are available wihin appsettings.json? #1448
ApplicationInsights does not inherently read ApplicationInsightsServiceOptions from appsettings.json #1806
ConnectionString not read from appsettings.json when using AddApplicationInsightsTelemetry(ApplicationInsightsServiceOptions) #1726
Configuration issue with AzureKeyVault #1878
Current Behavior
Which ASP.NET Core Configuration providers are supported with Application Insights?
Configuration providers that are added later override previous key settings. For example, if
InstrumentationKey
is set in bothappsettings.json
and theenvironment variable
, theenvironment variable
value is used. Application Insights special environment variables configuration provider, overrides values from all other providers.What are the names of special Application Insights Environment Variables?
APPINSIGHTS_INSTRUMENTATIONKEY
,APPLICATIONINSIGHTS_CONNECTION_STRING
,APPINSIGHTS_DEVELOPER_MODE
,APPINSIGHTS_ENDPOINTADDRESS
Which application insights properties are supported through configuration file?.
InstrumentationKey
,ConnectionString
,DeveloperMode
andEndpointAddress
What happens if additional properties like
EnableAdaptiveSampling
,EnableHeartbeat
are present in ASP.NET Core Configuration?Application Insights will not read these properties and will not be used when tracking an app.
Is there a workaround to read other application insights properties defined in
ApplicationInsightsServiceOptions
through ASP.NET Core Configuration Providers?Please refer #1806 for workaround.
Documentation: https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#enable-application-insights-server-side-telemetry-no-visual-studio
Proposal
ApplicationInsightsServiceOptions
from any ASP.NET Core Configuration Providers.IConfiguration
used within an application. A call toservices.AddApplicationInsightsTelemetry()
will read properties from any custom configuration providers like JSON file, XML file, Azure Key Vault, etc.,Which ASP.NET Core Configuration providers will be supported?
All Configuration supported with ASP.NET Core Framework.
What is the hierarchy of configuration file?
Is the new configuration model supported in all versions of .NET Framework?
No. These changes will be available to .NET Core apps that target
NET461
,NETSTANDARD2.0
or higher versions.A .NET Core app is targeting NET46, would these changes impact that app?
There are no impact with these changes to apps targeting old version of .NET Framework. It should continue to work in the same way as defined in current behavior section.
The text was updated successfully, but these errors were encountered: