diff --git a/.github/workflows/docker-deploy.yaml b/.github/workflows/docker-deploy.yaml index 3cac278..734bcfd 100644 --- a/.github/workflows/docker-deploy.yaml +++ b/.github/workflows/docker-deploy.yaml @@ -33,6 +33,7 @@ jobs: $content = $content.Replace("[APIKEY]", "${{ secrets.APIKEY }}") $content = $content.Replace("[AZURE_TABLESTORAGE_CONNECTIONSTRING]", "${{ secrets.AZURE_TABLESTORAGE_CONNECTIONSTRING }}") $content = $content.Replace("[CERTIFICATE_BASE64]", "${{ secrets.CERTIFICATE_BASE64 }}") + $content = $content.Replace("[AZURE_INSIGHTS_INSTRUMENTATIONKEY]", "${{ secrets.AZURE_INSIGHTS_INSTRUMENTATIONKEY }}") Set-Content -Path Config.Release.json -Value $content Write-Host "Placeholder replaced successfully in Config.Release.json" diff --git a/GuildWarsPartySearch/Config.Debug.json b/GuildWarsPartySearch/Config.Debug.json index 9e8a175..b40f215 100644 --- a/GuildWarsPartySearch/Config.Debug.json +++ b/GuildWarsPartySearch/Config.Debug.json @@ -25,6 +25,11 @@ "Default": "Debug", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" + }, + "ApplicationInsights": { + "LogLevel": { + "Default": "Information" + } } }, "EnvironmentOptions": { @@ -46,5 +51,8 @@ "ContainerName": "content", "UpdateFrequency": "0:5:0", "StagingFolder": "Content" + }, + "ApplicationInsights": { + "InstrumentationKey": "[AZURE_INSIGHTS_INSTRUMENTATIONKEY]" } } \ No newline at end of file diff --git a/GuildWarsPartySearch/Config.Release.json b/GuildWarsPartySearch/Config.Release.json index b6130be..86d0995 100644 --- a/GuildWarsPartySearch/Config.Release.json +++ b/GuildWarsPartySearch/Config.Release.json @@ -22,9 +22,14 @@ }, "Logging": { "LogLevel": { - "Default": "Information", + "Default": "Debug", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" + }, + "ApplicationInsights": { + "LogLevel": { + "Default": "Information" + } } }, "EnvironmentOptions": { @@ -46,5 +51,8 @@ "ContainerName": "content", "UpdateFrequency": "0:1:0", "StagingFolder": "Content" + }, + "ApplicationInsights": { + "InstrumentationKey": "[AZURE_INSIGHTS_INSTRUMENTATIONKEY]" } } \ No newline at end of file diff --git a/GuildWarsPartySearch/GuildWarsPartySearch.Server.csproj b/GuildWarsPartySearch/GuildWarsPartySearch.Server.csproj index 9180daf..02a83a2 100644 --- a/GuildWarsPartySearch/GuildWarsPartySearch.Server.csproj +++ b/GuildWarsPartySearch/GuildWarsPartySearch.Server.csproj @@ -12,8 +12,12 @@ + + + + diff --git a/GuildWarsPartySearch/Launch/ServerConfiguration.cs b/GuildWarsPartySearch/Launch/ServerConfiguration.cs index ad784f1..f3c2463 100644 --- a/GuildWarsPartySearch/Launch/ServerConfiguration.cs +++ b/GuildWarsPartySearch/Launch/ServerConfiguration.cs @@ -54,6 +54,7 @@ public static ILoggingBuilder SetupLogging(this ILoggingBuilder builder) { builder.ThrowIfNull() .ClearProviders() + .AddApplicationInsights() .AddConsole(); return builder; @@ -77,6 +78,7 @@ public static IServiceCollection SetupServices(this IServiceCollection services) { services.ThrowIfNull(); + services.AddApplicationInsightsTelemetry(); services.AddMemoryCache(); services.AddInMemoryRateLimiting(); services.AddScoped(); diff --git a/GuildWarsPartySearch/Properties/launchSettings.json b/GuildWarsPartySearch/Properties/launchSettings.json index 5f6c274..2c9296e 100644 --- a/GuildWarsPartySearch/Properties/launchSettings.json +++ b/GuildWarsPartySearch/Properties/launchSettings.json @@ -7,7 +7,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:57442;http://localhost:57443" + "applicationUrl": "https://localhost:443;http://localhost:80" } } } \ No newline at end of file