Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use appinsights pkg for isolated az func #442

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
897305b
chore: use preview appinsights pkg for isolated az func
stijnmoreels Mar 8, 2023
4a04c11
pr-fix: update w/ trace logging for docker tests
stijnmoreels Mar 8, 2023
2bbc536
pr-tmp: try to see if the package addition is the cause
stijnmoreels Mar 8, 2023
7a03c6b
pr-fix: solely rely on worker pkg
stijnmoreels Mar 8, 2023
7b45272
pr-fix: solely rely on worker pkg
stijnmoreels Mar 8, 2023
f9065c5
pr-fix: solely rely on worker pkg
stijnmoreels Mar 8, 2023
0a3cc9b
pr-fix: solely rely on worker pkg
stijnmoreels Mar 8, 2023
25552fa
pr-fix: update with env var
stijnmoreels Mar 8, 2023
b6d6fc3
pr-fix: update with env var
stijnmoreels Mar 8, 2023
0514805
pr-fix: update with env var
stijnmoreels Mar 8, 2023
7be7a0f
pr-fix: remove app insights from az func regisration
stijnmoreels Mar 8, 2023
3331e24
pr-fix: remove app insights from az func regisration
stijnmoreels Mar 8, 2023
86c798e
pr-fix: realistic package deps
stijnmoreels Mar 8, 2023
7defdd7
pr-fix: use new app insights env var
stijnmoreels Mar 15, 2023
1ca0b8e
pr-fix: update arcus observability
stijnmoreels Mar 15, 2023
c58e094
pr-fix: simplify dependencies
stijnmoreels Mar 15, 2023
30180d3
pr-fix: complete upgrade arcus observability
stijnmoreels Mar 15, 2023
48da7bf
pr-fix: dockerfile setup
stijnmoreels Mar 15, 2023
3ff3e04
pr-fix: move preview package back to arcus
stijnmoreels Mar 15, 2023
22023ef
pr-fix: remaining package conflicts
stijnmoreels Mar 15, 2023
ab947c8
pr-fix: revert to original arcus observability dependency
stijnmoreels Mar 15, 2023
f77a415
pr-revert: unnecessary changes
stijnmoreels Mar 15, 2023
31f0296
Merge branch 'main' into chore/use-preview-appinsights-pkg
stijnmoreels Mar 22, 2023
57891d7
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Aug 8, 2023
0951b4f
pr-up: newest preview package workings
stijnmoreels Aug 8, 2023
36e029b
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Aug 16, 2023
214aee8
pr-fix: update dockerfile w/ new 7 .net sdk
stijnmoreels Aug 16, 2023
a240fe3
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Aug 16, 2023
201cb26
pr-fix: force add nuget package diagnostic source
stijnmoreels Aug 17, 2023
653bec2
Merge branch 'chore/use-preview-appinsights-pkg' of https://github.co…
stijnmoreels Aug 17, 2023
72ab5d5
pr-fix: conditional isolated
stijnmoreels Aug 17, 2023
bf576aa
pr-fix: update webjobs package
stijnmoreels Aug 17, 2023
7fd365e
Update Dockerfile
stijnmoreels Sep 8, 2023
3005e3e
Update Dockerfile
stijnmoreels Sep 8, 2023
3c2a2aa
Update Arcus.WebApi.Tests.Runtimes.AzureFunction.csproj
stijnmoreels Sep 8, 2023
d688672
Update run-docker-integration-tests.yml
stijnmoreels Sep 8, 2023
7167ab8
Update IServiceCollectionExtensions.cs
stijnmoreels Sep 8, 2023
6b1045f
Update IServiceCollectionExtensions.cs
stijnmoreels Sep 8, 2023
3129aaf
Update Arcus.WebApi.Tests.Integration.csproj
stijnmoreels Sep 8, 2023
6678d1a
Update Dockerfile
stijnmoreels Sep 8, 2023
d3323d5
Update Dockerfile
stijnmoreels Sep 8, 2023
94db9f5
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Dec 15, 2023
547f81d
Merge branch 'main' into chore/use-preview-appinsights-pkg
stijnmoreels Dec 25, 2023
dee5208
Merge branch 'chore/use-preview-appinsights-pkg' of https://github.co…
stijnmoreels Dec 25, 2023
8c9ba5e
pr-fix: correct missing package after merge w/ 'main'
stijnmoreels Dec 25, 2023
de912b1
pr-fix: revert az func isolated Dockerfile
stijnmoreels Dec 25, 2023
984b81b
pr-fix: revert az func in-process Dockerfile
stijnmoreels Dec 25, 2023
8f94bd8
Update Dockerfile
stijnmoreels Dec 25, 2023
46a5d94
Update Dockerfile
stijnmoreels Dec 25, 2023
aed2f2b
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Feb 19, 2024
cceb260
Update Arcus.WebApi.Logging.AzureFunctions.csproj
stijnmoreels Feb 19, 2024
ac7d38c
Merge branch 'main' into chore/use-preview-appinsights-pkg
stijnmoreels Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build/templates/run-docker-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ steps:
parameters:
dockerProjectName: '$(Project).Tests.Runtimes.AzureFunction.Isolated'
port: '$(Arcus.AzureFunctions.Isolated.HttpPort)'
envVars: |
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=$(Arcus.ApplicationInsights.InstrumentationKey)
- template: test/run-integration-tests.yml@templates
parameters:
dotnetSdkVersion: '$(DotNet.Sdk.Version)'
Expand All @@ -36,4 +38,4 @@ steps:
docker logs $(Project).Tests.Runtimes.AzureFunction.Isolated
failOnStderr: true
displayName: Show $(Project).Tests.Runtimes.AzureFunction.Isolated logs
condition: always()
condition: always()
4 changes: 3 additions & 1 deletion build/templates/start-docker-project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
dockerProjectName: ''
port: ''
envVars: {}

steps:
- bash: |
Expand Down Expand Up @@ -28,4 +29,5 @@ steps:
command: 'Run an image'
imageName: '${{ parameters.dockerProjectName }}:$(Build.BuildId)'
containerName: '${{ parameters.dockerProjectName }}'
ports: '${{ parameters.port }}:80'
ports: '${{ parameters.port }}:80'
envVars: ${{ parameters.envVars }}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
<ItemGroup>
<PackageReference Include="Arcus.Observability.Telemetry.Core" Version="[3.0.0,4.0.0)" />
<PackageReference Include="Arcus.Observability.Telemetry.AzureFunctions" Version="[3.0.0,4.0.0)" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Core" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.33" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.35" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Net;
using Arcus.Observability.Correlation;
using Arcus.Observability.Telemetry.Core;
using Arcus.WebApi.Logging;
using Arcus.WebApi.Logging.AzureFunctions;
using Arcus.WebApi.Logging.AzureFunctions.Correlation;
using Arcus.WebApi.Logging.Core.Correlation;
using GuardNet;
using Microsoft.ApplicationInsights;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

Expand Down Expand Up @@ -64,11 +60,8 @@ public static IFunctionsWorkerApplicationBuilder UseHttpCorrelation(
{
Guard.NotNull(builder, nameof(builder), "Requires a function worker builder instance to add the HTTP correlation middleware");

builder.Services.AddLogging(logging =>
{
logging.AddApplicationInsightsWebJobs()
.RemoveMicrosoftApplicationInsightsLoggerProvider();
});
builder.Services.AddApplicationInsightsTelemetryWorkerService();
builder.Services.ConfigureFunctionsApplicationInsights();

builder.Services.AddSingleton<ICorrelationInfoAccessor<CorrelationInfo>>(provider => provider.GetRequiredService<IHttpCorrelationInfoAccessor>());
builder.Services.AddSingleton(provider => (ICorrelationInfoAccessor) provider.GetRequiredService<IHttpCorrelationInfoAccessor>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ public static IServiceCollection AddHttpCorrelation(this IFunctionsHostBuilder b
return services;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ FROM base AS final
WORKDIR /home/site/wwwroot
COPY --from=publish /app/publish .
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<DockerFastModeProjectMountDirectory>/home/site/wwwroot</DockerFastModeProjectMountDirectory>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.33" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.13" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Arcus.WebApi.Logging.AzureFunctions\Arcus.WebApi.Logging.AzureFunctions.csproj" />
Expand All @@ -23,4 +22,4 @@
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Arcus.WebApi.Tests.Runtimes.AzureFunction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ FROM base AS final
WORKDIR /home/site/wwwroot
COPY --from=publish /app/publish .
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
17 changes: 10 additions & 7 deletions src/Arcus.WebApi.Tests.Runtimes.AzureFunction/host.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
}
"logging": {
"logLevel": {
"default": "Trace"
},
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
</PackageReference>
<PackageReference Include="IdentityServer4" Version="4.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Core" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Grpc" Version="1.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.1.4" />
Expand Down
Loading