Documentation Index

Fetch the complete documentation index at: https://docs.turbo360.com/llms.txt

Use this file to discover all available pages before exploring further.

.NET library

Prev Next

Overview

The Business Activity Monitoring (BAM) .NET library (Kovai.Turbo360.Bam) lets you instrument .NET applications to send transaction tracking data to BAM without writing raw HTTP calls. You install the library via NuGet, configure it with your BAM host credentials, and call its TransactionService methods to start transactions and record checkpoint stages.

Business value

The .NET library provides a strongly typed, code-first way to add BAM tracking to any .NET application. It eliminates boilerplate HTTP header construction and response parsing, letting teams focus on business logic rather than API mechanics. Because it integrates with the standard NuGet ecosystem, it fits naturally into existing CI/CD pipelines and dependency management workflows.

Prerequisites

  • A BAM environment deployed in your Azure subscription.
  • A business process configured in the Turbo360 portal (for example, OrderProcessing).
  • Visual Studio or another .NET IDE with NuGet package manager access.
  • Your BAM Host URL and Host API Key, available from Configuration > Connection details in the Turbo360 portal.

Required permissions

Permission Role
Read BAM configuration BAM Reader or higher
Send tracking data to BAM endpoints BAM Contributor or higher

How it works

The library wraps the BAM API endpoints (StartTransaction, CheckPoint) in a TransactionService class. You instantiate the service with your Functions App Key and Functions App URL, then call methods on it to record the lifecycle of a business transaction. The library handles request serialization, header injection, and response deserialization.

You pass the TransactionInstanceId returned by StartTransaction to each subsequent checkpoint call to correlate all stages under the same transaction instance.

Steps

The following steps walk through installing the library and recording an order-processing transaction. Retrieve your Host URL and Host API Key from Configuration > Connection details in the Turbo360 portal before starting.

Install the .NET library

Installing the NuGet package adds the BAM tracking library to your .NET project.

  1. Open your project in Visual Studio.
  2. Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
  3. Search for Kovai.Turbo360.Bam.
  4. Select the package and click Install.

Configure the TransactionService

Configuring the service initialises it with your BAM credentials so all tracking calls are authenticated and routed to the correct Function App.

In your <FileName>.cs file, add the following using directives and instantiate TransactionService with your Functions App Key and URL:

using Kovai.Turbo360.Bam;
using System;
using System.Collections.Generic;
 
namespace BamNuget
{
    class Program
    {
        static void Main(string[] args)
        {
           var TransactionService = new TransactionService("FunctionAppKey", "FunctionAppUrl");
        }
    }
}

Replace "FunctionAppKey" and "FunctionAppUrl" with the values from Configuration > Connection details.

Example scenario

The following example tracks an order-processing flow with a start transaction, a segregation stage checkpoint, and a final accepted/declined checkpoint.

Step 1 — Define your business process and transaction names:

In your <FileName>.cs file, set the BusinessProcess tracking name (for example, OrderProcessing) and the Transaction tracking name (for example, ValidateOrders), along with the message body.

Step 2 — Start the transaction:

Call StartTransaction with the mandatory BusinessProcess and Transaction tracking names. Optionally pass a Stage tracking name and Stage Status.

If the transaction call returns an invalid result, check your API key and Function App URL — the error typically indicates a network or credential issue.

Step 3 — Add a checkpoint for the segregate-orders stage:

Create a checkpoint for the Segregate Orders stage. The flow branches based on the IsValid parameter you pass.

Step 4 — Record the outcome:

Depending on the IsValid result, record either an accepted or declined checkpoint.

Configuration

To mark a transaction as complete, set IsTransactionComplete to true in your checkpoint call. Alternatively, enable Mark transaction as complete or failed in the Turbo360 portal under stage configuration.

Troubleshooting

  1. TransactionService throws an authentication error on startup.
    Cause: The Functions App Key or Functions App URL passed to the constructor is incorrect.
    Fix: Copy the exact values from Configuration > Connection details in the Turbo360 portal and ensure no trailing spaces are included.

  2. StartTransaction returns null or an invalid TransactionInstanceId.
    Cause: The business process name or transaction name does not match what is configured in the Turbo360 portal.
    Fix: Verify the BusinessProcess and Transaction values in your code exactly match the names in the portal configuration.

  3. Checkpoint call does not appear under the expected transaction instance.
    Cause: The TransactionInstanceId passed to the checkpoint was not captured correctly from the StartTransaction response.
    Fix: Store the TransactionInstanceId from the StartTransaction response and pass it unmodified to all subsequent checkpoint calls.

  4. NuGet package fails to install in Visual Studio.
    Cause: The package source is not configured or there is a version conflict with an existing dependency.
    Fix: Confirm the NuGet package source includes nuget.org. Check for conflicting versions of Kovai.Turbo360.Bam and resolve by updating to the latest compatible version.

  5. Transaction status remains InProgress even after calling the final checkpoint.
    Cause: IsTransactionComplete was not set to true on the final checkpoint call.
    Fix: Set IsTransactionComplete = true in the final checkpoint, or enable the Mark transaction as complete option in stage configuration in the Turbo360 portal.

Related articles