Ingestion Endpoint in Connection String not respected in WASM standalone mode
chris1411 opened this issue · comments
I follwed the instructions on setting up a WASM standalone app. My connection string to App insights contains an IngestionEndpoint at the end of it. Here is an example:
InstrumentationKey=00000000-0000-0000-0000-000000000000;EndpointSuffix=applicationinsights.us;IngestionEndpoint=https://usgovvirginia-1.in.applicationinsights.azure.us/;
However, when trace events are sent to app insights, they are still going to the default endpoint: https://dc.services.visualstudio.com/v2/track
If I remove the BlazorApplicationInsights package and use the ApplicationInsightsJs file directly (and update the snippet code to contain my actual connection string), then the correct endpoint is utilized.
Hey,
Looks like when we reload the config on startup, the connection string isnt fully parsed by the appinsights-js library.
As a workaround, you can set it manually:
builder.Services.AddBlazorApplicationInsights(config =>
{
config.ConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;EndpointSuffix=applicationinsights.us;IngestionEndpoint=https://usgovvirginia-1.in.applicationinsights.azure.us/;";
config.EndpointUrl = "https://usgovvirginia-1.in.applicationinsights.azure.us/v2/track";
});
that did the trick. thank you!