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
<PackageReference Include="CasCap.Api.AzureDevOps" Version="4.4.0" />
<PackageVersion Include="CasCap.Api.AzureDevOps" Version="4.4.0" />
<PackageReference Include="CasCap.Api.AzureDevOps" />
paket add CasCap.Api.AzureDevOps --version 4.4.0
#r "nuget: CasCap.Api.AzureDevOps, 4.4.0"
#:package CasCap.Api.AzureDevOps@4.4.0
#addin nuget:?package=CasCap.Api.AzureDevOps&version=4.4.0
#tool nuget:?package=CasCap.Api.AzureDevOps&version=4.4.0
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,TaskVersionandTasks, for exampleidtoId,inputMaptoInputMap,defaultValuetoDefaultValueandvaluetoValue.Pipeline,StageAzDOandTemplateParameter, for examplestagestoStages,dependsOntoDependsOnandnametoName. The escaped@defaultmember is unchanged.Template.taskGrouptoTemplate.TaskGroup, andTaskGroupVersion.taskGroupId/versiontoTaskGroupId/Version. Named constructor arguments forTaskGroupVersionare nowtaskGroupIdandversion, 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
Warningsonly afterGenPipeline()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
| Product | Versions 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. |
-
net10.0
- AzurePipelinesToGitHubActionsConverter.Core (>= 1.4.6)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Net (>= 4.17.0)
- Microsoft.TeamFoundation.DistributedTask.WebApi (>= 20.256.2)
- Microsoft.TeamFoundationServer.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Release.Client (>= 20.256.2)
- Newtonsoft.Json (>= 13.0.4)
- semver (>= 3.0.0)
- System.Configuration.ConfigurationManager (>= 10.0.13)
- System.Security.Cryptography.Xml (>= 10.0.13)
- YamlDotNet (>= 18.1.0)
-
net8.0
- AzurePipelinesToGitHubActionsConverter.Core (>= 1.4.6)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Net (>= 4.17.0)
- Microsoft.TeamFoundation.DistributedTask.WebApi (>= 20.256.2)
- Microsoft.TeamFoundationServer.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Release.Client (>= 20.256.2)
- Newtonsoft.Json (>= 13.0.4)
- semver (>= 3.0.0)
- System.Configuration.ConfigurationManager (>= 10.0.13)
- System.Security.Cryptography.Xml (>= 10.0.13)
- YamlDotNet (>= 18.1.0)
-
net9.0
- AzurePipelinesToGitHubActionsConverter.Core (>= 1.4.6)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Net (>= 4.17.0)
- Microsoft.TeamFoundation.DistributedTask.WebApi (>= 20.256.2)
- Microsoft.TeamFoundationServer.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Client (>= 20.256.2)
- Microsoft.VisualStudio.Services.Release.Client (>= 20.256.2)
- Newtonsoft.Json (>= 13.0.4)
- semver (>= 3.0.0)
- System.Configuration.ConfigurationManager (>= 10.0.13)
- System.Security.Cryptography.Xml (>= 10.0.13)
- YamlDotNet (>= 18.1.0)
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 | 42 | 10/24/2026 |
| 4.3.4 | 97 | 10/4/2026 |
| 4.3.3 | 118 | 9/26/2026 |
| 4.3.2 | 99 | 9/23/2026 |
| 4.3.1 | 104 | 9/21/2026 |
| 4.3.0 | 114 | 9/19/2026 |
| 4.2.4 | 112 | 9/11/2026 |
| 4.2.3 | 115 | 9/7/2026 |
| 4.2.2 | 120 | 9/6/2026 |
| 4.2.1 | 114 | 9/6/2026 |
| 4.2.0 | 115 | 9/6/2026 |
| 4.1.1 | 119 | 9/6/2026 |
| 4.1.0 | 143 | 9/6/2026 |
| 4.0.0 | 117 | 9/4/2026 |
| 3.1.6 | 113 | 9/4/2026 |
| 3.1.5 | 119 | 8/18/2026 |
| 3.1.4 | 115 | 8/18/2026 |
| 3.1.3 | 146 | 3/21/2026 |
| 3.1.2 | 149 | 2/2/2026 |
| 3.1.1 | 143 | 1/28/2026 |