From 78750cb05a7377a0589deffb842291cbac8719ad Mon Sep 17 00:00:00 2001 From: evgenyfedorov2 <25526458+evgenyfedorov2@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:35:08 +0100 Subject: [PATCH 1/2] Initial commit --- docs/core/enrichment/build-metadata.md | 166 ++++++++++++++++++ .../snippets/buildmetadata/Program-access.cs | 17 ++ .../Program-configure-programmatic.cs | 16 ++ .../buildmetadata/Program-configure.cs | 10 ++ .../snippets/buildmetadata/Program-logging.cs | 33 ++++ .../snippets/buildmetadata/Program.cs | 39 ++++ .../buildmetadata/appsettings-simple.json | 8 + .../snippets/buildmetadata/appsettings.json | 13 ++ .../buildmetadata/buildmetadata.csproj | 22 +++ docs/navigate/tools-diagnostics/toc.yml | 2 + 10 files changed, 326 insertions(+) create mode 100644 docs/core/enrichment/build-metadata.md create mode 100644 docs/core/enrichment/snippets/buildmetadata/Program-access.cs create mode 100644 docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs create mode 100644 docs/core/enrichment/snippets/buildmetadata/Program-configure.cs create mode 100644 docs/core/enrichment/snippets/buildmetadata/Program-logging.cs create mode 100644 docs/core/enrichment/snippets/buildmetadata/Program.cs create mode 100644 docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json create mode 100644 docs/core/enrichment/snippets/buildmetadata/appsettings.json create mode 100644 docs/core/enrichment/snippets/buildmetadata/buildmetadata.csproj diff --git a/docs/core/enrichment/build-metadata.md b/docs/core/enrichment/build-metadata.md new file mode 100644 index 0000000000000..6f5b05282e6d1 --- /dev/null +++ b/docs/core/enrichment/build-metadata.md @@ -0,0 +1,166 @@ +--- +title: Build ambient metadata +description: Learn how to use build metadata to capture and access CI/CD build information about your application at runtime in .NET. +ms.date: 01/16/2026 +--- + +# Build ambient metadata + +The [`Microsoft.Extensions.AmbientMetadata.Build`](https://www.nuget.org/packages/Microsoft.Extensions.AmbientMetadata.Build) NuGet package provides functionality to capture build-related information and access it at runtime. During the build process, source generation captures details from CI/CD pipelines (such as build IDs, commit information, and branch names) and embeds them into the compiled application, making them available for traceability, troubleshooting, and deployment tracking. + +## Why use build metadata + +Build metadata provides context about the specific build that produced your running application, which enhances operational visibility: + +- **Traceability**: Link runtime behavior directly to specific builds and source code commits. +- **Troubleshooting**: Quickly identify which commit or build introduced issues in production. +- **Deployment tracking**: Know exactly what code version is running in each environment. +- **Audit and compliance**: Maintain detailed records of what code was deployed and when. +- **Telemetry enrichment**: Automatically add build context to logs, metrics, and traces. + +## Supported CI/CD platforms + +During the build process, the build metadata component uses source generation to capture environment variables from: + +- **Azure DevOps Pipelines**: Captures standard Azure Pipelines build variables during build +- **GitHub Actions**: Captures GitHub Actions workflow environment variables during build + +The component works seamlessly in these CI/CD environments, automatically embedding build information into the compiled application without requiring manual configuration. + +## Install the package + +To get started, install the [📦 Microsoft.Extensions.AmbientMetadata.Build](https://www.nuget.org/packages/Microsoft.Extensions.AmbientMetadata.Build) NuGet package: + +### [.NET CLI](#tab/dotnet-cli) + +```dotnetcli +dotnet add package Microsoft.Extensions.AmbientMetadata.Build +``` + +Or, if you're using .NET 10+ SDK: + +```dotnetcli +dotnet package add Microsoft.Extensions.AmbientMetadata.Build +``` + +### [PackageReference](#tab/package-reference) + +```xml + +``` + +--- + +## Configure build metadata + +Build metadata can be configured through the dependency injection container using the extension method. During the build process, the component uses source generation to capture build information from environment variables and embed it into the compiled application. + +### Configure with IServiceCollection + +Use the extension method to register build metadata: + +:::code language="csharp" source="snippets/buildmetadata/Program-configure.cs"::: + +Alternatively, you can configure build metadata programmatically: + +:::code language="csharp" source="snippets/buildmetadata/Program-configure-programmatic.cs"::: + +### Configure with appsettings.json + +You can also provide build metadata through configuration files: + +:::code language="json" source="snippets/buildmetadata/appsettings-simple.json"::: + +## Environment variable integration + +During the build process, source generation captures values from CI/CD environment variables and embeds them into the compiled application. The following table shows how properties map to environment variables in different CI/CD systems: + +| Property | Azure DevOps Variable | GitHub Actions Variable | Description | +|---------------------|----------------------|------------------------|-------------| +| `BuildId` | `BUILD_BUILDID` | `GITHUB_RUN_ID` | The unique identifier for the build/workflow run | +| `BuildNumber` | `BUILD_BUILDNUMBER` | `GITHUB_RUN_NUMBER` | The name or number of the build/run | +| `SourceBranchName` | `BUILD_SOURCEBRANCHNAME` | `GITHUB_REF_NAME` | The name of the branch being built | +| `SourceVersion` | `BUILD_SOURCEVERSION` | `GITHUB_SHA` | The commit SHA being built | + +When you build your application in a CI/CD pipeline, these values are automatically captured and hard-coded into the application. You don't need to manually configure them unless you're building outside of a supported CI/CD environment or want to override the automatic values. + +## Access build metadata + +Once configured, you can inject and use the type: + +:::code language="csharp" source="snippets/buildmetadata/Program-access.cs"::: + +## BuildMetadata properties + +The class includes the following properties: + +| Property | Description | Example Value | +|---------------------|-----------------------------------------------------------------|---------------| +| `BuildId` | The ID of the record for the build, also known as the run ID. | `12345` | +| `BuildNumber` | The name of the completed build, also known as the run number. | `1.0.0-ci.20260116.1` | +| `SourceBranchName` | The name of the branch in the triggering repo the build was queued for, also known as the ref name. | `main`, `feature/new-api` | +| `SourceVersion` | The latest version control change that is included in this build, also known as the commit SHA. | `a1b2c3d4e5f6789012345678901234567890abcd` | + +All properties are nullable strings and are automatically captured from CI/CD environment variables during the build process via source generation. + +## Use with logging + +Build metadata is particularly useful for enriching log messages with build context: + +:::code language="csharp" source="snippets/buildmetadata/Program-logging.cs"::: + +## Complete example + +Here's a complete example showing how to set up and use build metadata: + +**appsettings.json:** + +:::code language="json" source="snippets/buildmetadata/appsettings.json"::: + +**Program.cs:** + +:::code language="csharp" source="snippets/buildmetadata/Program.cs"::: + +### Output + +The output includes build metadata in the log messages: + +``` +info: ApplicationService[0] + Application started - Build: 1.0.0-ci.20260116.1, Branch: main, Commit: a1b2c3d +``` + +## CI/CD integration + +### Azure DevOps Pipelines + +When building in Azure DevOps Pipelines, the build metadata component uses source generation to capture values from predefined build variables and embed them into the compiled application. These variables are available in all pipeline types (YAML, classic build, and release pipelines). + +The following environment variables are captured during the build process: + +- `BUILD_BUILDID`: The ID of the build +- `BUILD_BUILDNUMBER`: The name/number of the build +- `BUILD_SOURCEBRANCHNAME`: The branch name (for example, `main`, `develop`) +- `BUILD_SOURCEVERSION`: The commit SHA that triggered the build + +For more information about Azure DevOps build variables, see [Use predefined variables](/azure/devops/pipelines/build/variables). + +### GitHub Actions + +When building in GitHub Actions workflows, the build metadata component uses source generation to capture values from default environment variables and embed them into the compiled application. + +The following environment variables are captured during the build process: + +- `GITHUB_RUN_ID`: The unique identifier for the workflow run +- `GITHUB_RUN_NUMBER`: A unique number for each run of a particular workflow +- `GITHUB_REF_NAME`: The branch or tag name that triggered the workflow +- `GITHUB_SHA`: The commit SHA that triggered the workflow + +For more information about GitHub Actions environment variables, see [Default environment variables](https://docs.github.com/actions/learn-github-actions/variables#default-environment-variables). + +## Next steps + +- Learn about [application metadata](application-metadata.md) for capturing application-level information +- Learn about [log enrichment overview](overview.md) to understand how to enrich telemetry with metadata +- Learn about [application log enricher](application-log-enricher.md) to automatically add metadata to logs diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-access.cs b/docs/core/enrichment/snippets/buildmetadata/Program-access.cs new file mode 100644 index 0000000000000..5eb3adf28a4af --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/Program-access.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.AmbientMetadata; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +var builder = Host.CreateApplicationBuilder(args); +builder.Services.AddBuildMetadata(builder.Configuration.GetSection("BuildMetadata")); + +var host = builder.Build(); + +var metadata = host.Services.GetRequiredService>().Value; +Console.WriteLine($"Build ID: {metadata.BuildId}"); +Console.WriteLine($"Build Number: {metadata.BuildNumber}"); +Console.WriteLine($"Branch: {metadata.SourceBranchName}"); +Console.WriteLine($"Commit: {metadata.SourceVersion}"); + +await host.RunAsync(); diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs b/docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs new file mode 100644 index 0000000000000..5911505dc06bf --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.AmbientMetadata; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(args); + +builder.Services.AddBuildMetadata(metadata => +{ + metadata.BuildId = "12345"; + metadata.BuildNumber = "1.0.0-ci.20260116.1"; + metadata.SourceBranchName = "main"; + metadata.SourceVersion = "a1b2c3d4e5f6"; +}); + +var host = builder.Build(); +await host.RunAsync(); diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-configure.cs b/docs/core/enrichment/snippets/buildmetadata/Program-configure.cs new file mode 100644 index 0000000000000..8d2557ff49385 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/Program-configure.cs @@ -0,0 +1,10 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(args); + +// Register build metadata (automatically captures from environment variables) +builder.Services.AddBuildMetadata(builder.Configuration.GetSection("BuildMetadata")); + +var host = builder.Build(); +await host.RunAsync(); diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-logging.cs b/docs/core/enrichment/snippets/buildmetadata/Program-logging.cs new file mode 100644 index 0000000000000..480d681bb7878 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/Program-logging.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.AmbientMetadata; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +var builder = Host.CreateApplicationBuilder(args); + +builder.Services.AddBuildMetadata(builder.Configuration.GetSection("BuildMetadata")); +builder.Services.AddSingleton(); + +var host = builder.Build(); + +var loggingService = host.Services.GetRequiredService(); +loggingService.LogWithBuildInfo(); + +await host.RunAsync(); + +public class LoggingService( + ILogger logger, + IOptions metadata) +{ + private readonly ILogger _logger = logger; + private readonly BuildMetadata _metadata = metadata.Value; + + public void LogWithBuildInfo() + { + _logger.LogInformation( + "Processing request from build {BuildNumber} (commit: {Commit})", + _metadata.BuildNumber, + _metadata.SourceVersion?[..7]); // Short commit SHA + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata/Program.cs b/docs/core/enrichment/snippets/buildmetadata/Program.cs new file mode 100644 index 0000000000000..35c5f991a2ebe --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/Program.cs @@ -0,0 +1,39 @@ +using Microsoft.Extensions.AmbientMetadata; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +var builder = Host.CreateApplicationBuilder(args); + +// Register build metadata +builder.Services.AddBuildMetadata(builder.Configuration.GetSection("BuildMetadata")); + +// Register application service +builder.Services.AddSingleton(); + +var host = builder.Build(); + +// Use build metadata +var appService = host.Services.GetRequiredService(); +appService.Start(); + +await host.RunAsync(); + +public class ApplicationService( + ILogger logger, + IOptions buildMetadata) +{ + private readonly ILogger _logger = logger; + private readonly BuildMetadata _buildMetadata = buildMetadata.Value; + + public void Start() + { + _logger.LogInformation( + "Application started - Build: {BuildNumber}, Branch: {Branch}, Commit: {Commit}", + _buildMetadata.BuildNumber, + _buildMetadata.SourceBranchName, + _buildMetadata.SourceVersion?[..7]); + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json b/docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json new file mode 100644 index 0000000000000..84b7cf20aa369 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json @@ -0,0 +1,8 @@ +{ + "BuildMetadata": { + "BuildId": "12345", + "BuildNumber": "1.0.0-ci.20260116.1", + "SourceBranchName": "main", + "SourceVersion": "a1b2c3d4e5f6789012345678901234567890abcd" + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata/appsettings.json b/docs/core/enrichment/snippets/buildmetadata/appsettings.json new file mode 100644 index 0000000000000..e878ba8d825bc --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/appsettings.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information" + } + }, + "BuildMetadata": { + "BuildId": "12345", + "BuildNumber": "1.0.0-ci.20260116.1", + "SourceBranchName": "main", + "SourceVersion": "a1b2c3d4e5f6789012345678901234567890abcd" + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata/buildmetadata.csproj b/docs/core/enrichment/snippets/buildmetadata/buildmetadata.csproj new file mode 100644 index 0000000000000..1396c3220f0f1 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata/buildmetadata.csproj @@ -0,0 +1,22 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + + PreserveNewest + + + + diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 612e7ce530ccc..4081765105bd0 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -464,6 +464,8 @@ items: href: ../../core/enrichment/overview.md - name: Application metadata href: ../../core/enrichment/application-metadata.md + - name: Build metadata + href: ../../core/enrichment/build-metadata.md - name: Application log enricher href: ../../core/enrichment/application-log-enricher.md - name: Process log enricher From 134a8007705d4459c920fb1f1e593165d496dee0 Mon Sep 17 00:00:00 2001 From: evgenyfedorov2 <25526458+evgenyfedorov2@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:52:00 +0100 Subject: [PATCH 2/2] fix snippets --- docs/core/enrichment/build-metadata.md | 10 ++++----- .../Program.cs} | 0 .../appsettings.json} | 0 .../buildmetadata-access.csproj | 21 ++++++++++++++++++ .../Program.cs} | 0 ...uildmetadata-configure-programmatic.csproj | 15 +++++++++++++ .../Program.cs} | 0 .../buildmetadata-configure/appsettings.json | 8 +++++++ .../buildmetadata-configure.csproj | 21 ++++++++++++++++++ .../Program.cs} | 0 .../buildmetadata-logging/appsettings.json | 8 +++++++ .../buildmetadata-logging.csproj | 22 +++++++++++++++++++ 12 files changed, 100 insertions(+), 5 deletions(-) rename docs/core/enrichment/snippets/{buildmetadata/Program-access.cs => buildmetadata-access/Program.cs} (100%) rename docs/core/enrichment/snippets/{buildmetadata/appsettings-simple.json => buildmetadata-access/appsettings.json} (100%) create mode 100644 docs/core/enrichment/snippets/buildmetadata-access/buildmetadata-access.csproj rename docs/core/enrichment/snippets/{buildmetadata/Program-configure-programmatic.cs => buildmetadata-configure-programmatic/Program.cs} (100%) create mode 100644 docs/core/enrichment/snippets/buildmetadata-configure-programmatic/buildmetadata-configure-programmatic.csproj rename docs/core/enrichment/snippets/{buildmetadata/Program-configure.cs => buildmetadata-configure/Program.cs} (100%) create mode 100644 docs/core/enrichment/snippets/buildmetadata-configure/appsettings.json create mode 100644 docs/core/enrichment/snippets/buildmetadata-configure/buildmetadata-configure.csproj rename docs/core/enrichment/snippets/{buildmetadata/Program-logging.cs => buildmetadata-logging/Program.cs} (100%) create mode 100644 docs/core/enrichment/snippets/buildmetadata-logging/appsettings.json create mode 100644 docs/core/enrichment/snippets/buildmetadata-logging/buildmetadata-logging.csproj diff --git a/docs/core/enrichment/build-metadata.md b/docs/core/enrichment/build-metadata.md index 6f5b05282e6d1..dbc52031956e2 100644 --- a/docs/core/enrichment/build-metadata.md +++ b/docs/core/enrichment/build-metadata.md @@ -60,17 +60,17 @@ Build metadata can be configured through the dependency injection container usin Use the extension method to register build metadata: -:::code language="csharp" source="snippets/buildmetadata/Program-configure.cs"::: +:::code language="csharp" source="snippets/buildmetadata-configure/Program.cs"::: Alternatively, you can configure build metadata programmatically: -:::code language="csharp" source="snippets/buildmetadata/Program-configure-programmatic.cs"::: +:::code language="csharp" source="snippets/buildmetadata-configure-programmatic/Program.cs"::: ### Configure with appsettings.json You can also provide build metadata through configuration files: -:::code language="json" source="snippets/buildmetadata/appsettings-simple.json"::: +:::code language="json" source="snippets/buildmetadata-configure/appsettings.json"::: ## Environment variable integration @@ -89,7 +89,7 @@ When you build your application in a CI/CD pipeline, these values are automatica Once configured, you can inject and use the type: -:::code language="csharp" source="snippets/buildmetadata/Program-access.cs"::: +:::code language="csharp" source="snippets/buildmetadata-access/Program.cs"::: ## BuildMetadata properties @@ -108,7 +108,7 @@ All properties are nullable strings and are automatically captured from CI/CD en Build metadata is particularly useful for enriching log messages with build context: -:::code language="csharp" source="snippets/buildmetadata/Program-logging.cs"::: +:::code language="csharp" source="snippets/buildmetadata-logging/Program.cs"::: ## Complete example diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-access.cs b/docs/core/enrichment/snippets/buildmetadata-access/Program.cs similarity index 100% rename from docs/core/enrichment/snippets/buildmetadata/Program-access.cs rename to docs/core/enrichment/snippets/buildmetadata-access/Program.cs diff --git a/docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json b/docs/core/enrichment/snippets/buildmetadata-access/appsettings.json similarity index 100% rename from docs/core/enrichment/snippets/buildmetadata/appsettings-simple.json rename to docs/core/enrichment/snippets/buildmetadata-access/appsettings.json diff --git a/docs/core/enrichment/snippets/buildmetadata-access/buildmetadata-access.csproj b/docs/core/enrichment/snippets/buildmetadata-access/buildmetadata-access.csproj new file mode 100644 index 0000000000000..8ab8d4b62380c --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-access/buildmetadata-access.csproj @@ -0,0 +1,21 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + PreserveNewest + + + + diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs b/docs/core/enrichment/snippets/buildmetadata-configure-programmatic/Program.cs similarity index 100% rename from docs/core/enrichment/snippets/buildmetadata/Program-configure-programmatic.cs rename to docs/core/enrichment/snippets/buildmetadata-configure-programmatic/Program.cs diff --git a/docs/core/enrichment/snippets/buildmetadata-configure-programmatic/buildmetadata-configure-programmatic.csproj b/docs/core/enrichment/snippets/buildmetadata-configure-programmatic/buildmetadata-configure-programmatic.csproj new file mode 100644 index 0000000000000..dae7e214aae57 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-configure-programmatic/buildmetadata-configure-programmatic.csproj @@ -0,0 +1,15 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-configure.cs b/docs/core/enrichment/snippets/buildmetadata-configure/Program.cs similarity index 100% rename from docs/core/enrichment/snippets/buildmetadata/Program-configure.cs rename to docs/core/enrichment/snippets/buildmetadata-configure/Program.cs diff --git a/docs/core/enrichment/snippets/buildmetadata-configure/appsettings.json b/docs/core/enrichment/snippets/buildmetadata-configure/appsettings.json new file mode 100644 index 0000000000000..84b7cf20aa369 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-configure/appsettings.json @@ -0,0 +1,8 @@ +{ + "BuildMetadata": { + "BuildId": "12345", + "BuildNumber": "1.0.0-ci.20260116.1", + "SourceBranchName": "main", + "SourceVersion": "a1b2c3d4e5f6789012345678901234567890abcd" + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata-configure/buildmetadata-configure.csproj b/docs/core/enrichment/snippets/buildmetadata-configure/buildmetadata-configure.csproj new file mode 100644 index 0000000000000..8ab8d4b62380c --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-configure/buildmetadata-configure.csproj @@ -0,0 +1,21 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + PreserveNewest + + + + diff --git a/docs/core/enrichment/snippets/buildmetadata/Program-logging.cs b/docs/core/enrichment/snippets/buildmetadata-logging/Program.cs similarity index 100% rename from docs/core/enrichment/snippets/buildmetadata/Program-logging.cs rename to docs/core/enrichment/snippets/buildmetadata-logging/Program.cs diff --git a/docs/core/enrichment/snippets/buildmetadata-logging/appsettings.json b/docs/core/enrichment/snippets/buildmetadata-logging/appsettings.json new file mode 100644 index 0000000000000..84b7cf20aa369 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-logging/appsettings.json @@ -0,0 +1,8 @@ +{ + "BuildMetadata": { + "BuildId": "12345", + "BuildNumber": "1.0.0-ci.20260116.1", + "SourceBranchName": "main", + "SourceVersion": "a1b2c3d4e5f6789012345678901234567890abcd" + } +} diff --git a/docs/core/enrichment/snippets/buildmetadata-logging/buildmetadata-logging.csproj b/docs/core/enrichment/snippets/buildmetadata-logging/buildmetadata-logging.csproj new file mode 100644 index 0000000000000..1396c3220f0f1 --- /dev/null +++ b/docs/core/enrichment/snippets/buildmetadata-logging/buildmetadata-logging.csproj @@ -0,0 +1,22 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + + PreserveNewest + + + +