azure-devops-dotnet-samples
azure-devops-dotnet-samples copied to clipboard
Issue updating release template - Microsoft.VisualStudio.Services.Release.Client
Not sure if im at the right place but i was trying to use this dll: Microsoft.VisualStudio.Services.Release.Client
Basically im trying to copy the environment and variable detailled from one template to another. The following code works fine for copying the template variable. Although for the environment and the tasks, the code below doesn't work.
The commented code, doesn't work either.
How can i copy the environment details from one definition to another?
' Find the release definition we want to modify.
For Each releaseDef In releaseClient.GetReleaseDefinitionsAsync(project.Name).SyncResult
If releaseDef.Name = refReleasesDef.Name Then
Dim targetRelease = releaseClient.GetReleaseDefinitionAsync(project.Name, releaseDef.Id).SyncResult
targetRelease.Environments.Clear()
For Each e In refReleasesDef.Environments
targetRelease.Environments.Add(e)
Next
'For envIndex = 0 To refReleasesDef.Environments.Count - 1
' Dim refEnvironement = refReleasesDef.Environments(envIndex)
' Dim targetEnvironement = targetRelease.Environments(envIndex)
' targetEnvironement.DeployPhases.Clear()
' For Each p In refEnvironement.DeployPhases
' targetEnvironement.DeployPhases.Add(p)
' Next
'Next
targetRelease.Variables.Clear()
targetRelease.Variables = refReleasesDef.Variables
Dim r = releaseClient.UpdateReleaseDefinitionAsync(targetRelease, project.Name).Result
Continue For
End If
Next
Next
Is the Microsoft.VisualStudio.Services.ReleaseManagement.WebApi.dll sourcecode available anywhere?
Im trying to figure out if im using it wrong or if it is a bug... Also not too sure who to report bugs to?
The age of this issue is concerning. I'm finding very little in the way of documentation or examples for this set of APIs.