I want to trigger a YAML release pipeline via C# code. I am able to achieve this using the below REST API from Postman. However, Azure DevOps provides its own SDK for such purposes. How can I trigger a YAML release pipeline using the .NET SDK instead of calling the plain API from C#?
I need C#/.NET alternative to:
POST https://dev.azure.com/Dev/modernization/_apis/pipelines/30/runs?api-version=7.2-preview.1
BODY:
{
"previewRun": false,
"resources": {
"repositories": {
"self": {
"repository": {
"id": "PartsUnlimited",
"type": "azureReposGit"
},
"refName": "refs/heads/feature/branch4",
"version": "aaaaabbbbbbe6a1b2d7904b110zzzzzaaa400000"
}
},
"pipelines": {
"source_build" : {
"pipeline": {
"name": "tfvc-build"
},
"version": "4972"
}
}
},
"stagesToSkip": [
"Stage_Test1"
],
"templateParameters" : {
"number_A" : "2",
"number_B" : "4"
}
}