CasCap.Api.AzureDevOps 4.4.0

Prefix Reserved
dotnet add package CasCap.Api.AzureDevOps --version 4.4.0
                    
NuGet\Install-Package CasCap.Api.AzureDevOps -Version 4.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CasCap.Api.AzureDevOps" Version="4.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.AzureDevOps" Version="4.4.0" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.AzureDevOps" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CasCap.Api.AzureDevOps --version 4.4.0
                    
#r "nuget: CasCap.Api.AzureDevOps, 4.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CasCap.Api.AzureDevOps@4.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CasCap.Api.AzureDevOps&version=4.4.0
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.AzureDevOps&version=4.4.0
                    
Install as a Cake Tool

CasCap.Api.AzureDevOps

Azure DevOps client and conversion library for .NET applications migrating Classic Designer Build and Release definitions to Azure Pipelines YAML. It supplies the models and generator behind the yamlizr CLI.

Installation

dotnet add package CasCap.Api.AzureDevOps

The NuGet package targets net8.0, net9.0 and net10.0. Use the CLI for ready-made bulk conversion; the library leaves definition retrieval, catalogue construction, credential acquisition and file output to your host.

The checkout explicitly references supported System.Security.Cryptography.Xml to override the Azure DevOps SDK's older transitive version. This also removes its obsolete drawing dependency chain. Consumers should not downgrade that dependency; dependency resolution and offline tests do not establish live Azure DevOps connectivity.

Migrating to 4.4

Version 4.4 deliberately includes breaking C# model-member renames despite its minor version. Recompile library consumers and change member access and object initializers to PascalCase:

  • TaskObj, TaskInput, TaskVersion and Tasks, for example id to Id, inputMap to InputMap, defaultValue to DefaultValue and value to Value.
  • Pipeline, StageAzDO and TemplateParameter, for example stages to Stages, dependsOn to DependsOn and name to Name. The escaped @default member is unchanged.
  • Template.taskGroup to Template.TaskGroup, and TaskGroupVersion.taskGroupId / version to TaskGroupId / Version. Named constructor arguments for TaskGroupVersion are now taskGroupId and version, without the former leading underscores.

The Azure DevOps JSON names and emitted Azure Pipelines YAML names remain unchanged. TaskObj.InputMap is a derived lookup excluded from JSON; populate it from Inputs in the host. CLI commands do not require a corresponding syntax migration. Consumers that cannot migrate should remain on an earlier immutable package version.

Quick Start

In a .NET console application, retrieve the installed task catalogue. Supply the token through your host's secret store or environment, not source code:

using CasCap.Abstractions;
using CasCap.Services;
using Microsoft.Extensions.Logging.Abstractions;

var token = Environment.GetEnvironmentVariable("AZURE_DEVOPS_PAT")
    ?? throw new InvalidOperationException("Set AZURE_DEVOPS_PAT.");
IApiService api = new ApiService(NullLogger<ApiService>.Instance, token);
var tasks = await api.GetAllExtensions("https://dev.azure.com/example-org");
Console.WriteLine($"Installed tasks: {tasks?.Count ?? 0}");

IApiService is implemented by ApiService. It accepts a logger and token directly; there is no package-specific DI registration extension. The client uses Basic authentication with the token and an empty username. Use a valid, authorized, unexpired PAT or pipeline access token and avoid logging it.

Public API

Contract Consumer responsibility
IApiService.GetAllExtensions Pass the organization URI without a trailing slash; the result can be null.
IApiService.Validate Supply project, an existing enabled YAML pipeline ID, YAML and optional cancellation token. Returns a validity result, expanded YAML or rejection message.
YamlPipelineGenerator Supply exactly one full classic build or release definition, installed-task map by ID/major version, task-group map, shared template map and variable-group map. Select inline behavior and release phase type explicitly.
Pipeline Call ToString() to serialize the generated model.
Template Serialize and persist collected task-group templates when not inlining.
TaskObj Populate InputMap from the task's named inputs before generating.

For a complete catalogue-to-generator call path, see GenerateCommand. For offline definition construction and map shapes, see YamlizrTestData.

Behavior and Limits

  • One generator instance handles one definition. Read Warnings only after GenPipeline() returns and surface them to the caller. It returns null when nothing is convertible and throws if both definition arguments, or neither, are supplied.
  • Generated YAML is not production ready. Unsupported triggers, artifacts, approvals and gates need manual work; flattening can discard stage/job settings. Review the conversion coverage. Warnings do not establish semantic equivalence.
  • Preview validation parses YAML without queueing a run. Relative template references resolve against the target pipeline's repository; commit templates there or generate with task groups inlined. A successful preview does not establish runtime correctness or preserved approvals.
  • Both REST methods accept cancellation. Preview HTTP failures become an invalid result; transport failures can still throw. No conversion-level retry or rate-limit policy is implemented here. Your host must control concurrency and handle Azure DevOps access policies.
  • Definitions, generated YAML and diagnostic messages can carry sensitive project content. Protect files and log sinks; the library is not a secret-redaction layer.

Configuration

AzureDevOpsOptions defines the CasCap:AzureDevOpsOptions section used by the CLI and tests. Binding alone does not construct a client or enforce its data annotations; the consuming host supplies validated values.

Property Purpose
PAT Personal Access Token, or an access token issued to a pipeline's build service identity.
OrganisationUri Absolute Uri of the Azure DevOps organisation.
Project Name of the team project to convert.
ValidationPipelineId Optional enabled YAML pipeline ID used by validation callers, not bulk CLI generation.

Configuration Examples

Minimal non-secret connection settings (the token is supplied separately):

{
  "CasCap": {
    "AzureDevOpsOptions": {
      "OrganisationUri": "https://dev.azure.com/example-org",
      "Project": "ExampleProject"
    }
  }
}

Validation override fragment, merged into that section:

{
  "ValidationPipelineId": 1
}

Replace the synthetic ID with a real enabled pipeline. See Microsoft's PAT guidance and the CLI's permission guidance.

Data Flow

The host retrieves definitions using Azure DevOps SDK clients and supplies catalogues to the generator; the REST wrapper does not itself perform bulk conversion.

flowchart LR
  Host([Consuming host]) --> SDK[Azure DevOps SDK clients]
  Host --> API[ApiService]
  SDK --> Inputs[Definitions and groups]
  API --> Tasks[Installed tasks]
  Inputs --> Gen[YamlPipelineGenerator]
  Tasks --> Gen
  Gen --> Result[Pipeline, templates and warnings]
  Result --> Files[(Host-owned output)]
  Files -. optional preview .-> API
  classDef owned fill:#e8f0fe,stroke:#315da8
  class API,Gen,Result owned

Essential usage is described above; package renderers may not render Mermaid.

License

MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.4.0 49 10/24/2026
4.3.4 97 10/4/2026
4.3.3 119 9/26/2026
4.3.2 101 9/23/2026
4.3.1 104 9/21/2026
4.3.0 115 9/19/2026
4.2.4 113 9/11/2026
4.2.3 116 9/7/2026
4.2.2 121 9/6/2026
4.2.1 115 9/6/2026
4.2.0 116 9/6/2026
4.1.1 120 9/6/2026
4.1.0 144 9/6/2026
4.0.0 118 9/4/2026
3.1.6 114 9/4/2026
3.1.5 120 8/18/2026
3.1.4 116 8/18/2026
3.1.3 147 3/21/2026
3.1.2 150 2/2/2026
3.1.1 144 1/28/2026
Loading failed