Skip to content

Commit

Permalink
Use connection string for application insights
Browse files Browse the repository at this point in the history
  • Loading branch information
dstenroejl committed Jan 15, 2024
1 parent 7e867ce commit 1d59831
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using Azure.Identity;
using Azure.Monitor.Query;
using Energinet.DataHub.Core.FunctionApp.TestCommon;
using Energinet.DataHub.Core.FunctionApp.TestCommon.Configuration;
using ExampleHost.WebApi01;
using Microsoft.AspNetCore;
Expand All @@ -31,7 +32,9 @@ public ExampleHostFixture()
var web01BaseUrl = "http://localhost:5000";

IntegrationTestConfiguration = new IntegrationTestConfiguration();
Environment.SetEnvironmentVariable("APPINSIGHTS_INSTRUMENTATIONKEY", IntegrationTestConfiguration.ApplicationInsightsInstrumentationKey);
Environment.SetEnvironmentVariable(
"APPLICATIONINSIGHTS_CONNECTION_STRING",
IntegrationTestConfiguration.Configuration.GetValue("AZURE-APPINSIGHTS-CONNECTIONSTRING"));

// We cannot use TestServer as this would not work with Application Insights.
Web02Host = WebHost.CreateDefaultBuilder()
Expand Down

0 comments on commit 1d59831

Please sign in to comment.