Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
617 stars 239 forks source link

[Feature Request] Create Process flow and Create inherited process #1294

Open silverscout opened 1 year ago

silverscout commented 1 year ago

was wondering if there is a set of arguments that allow for Creation of inherited processes? I have searched everywhere.
If not, I am having a hard time invoking the webservice command do it. I can do it via normal Rest API. However, I would like to run the whole script using Azure CLI and not jump back and forth.

Here is the script I am running. Also, why does it have to be a file.. why can't it be a variable

Commented lines were when I was trying to do this all via API Calls. I was able to do this via API call without issue. I wish to this with AZ CLI tool so I don't have to auth a separate time.


$createProcessURL = "$orgUrl/_apis/work/processes?api-version=6.0-preview.2"

$ProcessTemplate = @{name = "Agile - $($proj)";parentProcessTypeId = "adcc42ab-9882-485e-a3ed-7678f01f66bc";referenceName = "$($projectName).MyNewAgileProcess";description = "My new process"} | ConvertTo-Json

#$response = Invoke-RestMethod -Uri $createProcessURL -Method Post -ContentType "application/json" -Headers $header -Body ($ProcessTemplate)

$ProcessTemplate | Out-File -FilePath "C:\PS Testing\body.json"

 az devops invoke `
 --area process `
 --accept-media-type "application/json" `
 --api-version=6.0-preview `
 --http-method "post" `
 --org "https://dev.azure.com/silverscout" `
 --in-file  "C:\PS Testing\body.json"

Error I am getting..

az : ERROR: Unable to decode file  'C:\PS Testing\body.json' with 'utf-8' encoding.
At line:5 char:1
+ az devops invoke `
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: Unable t...tf-8' encoding.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError