Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

[pipelines/environments] Ability to create and configure pipeline environments via the cli #23180

Open jack1902 opened 2 years ago

jack1902 commented 2 years ago

Related command

az pipelines environments create/delete/update/list - ability to carry out the actions specified on the API (appears to only be visible on 6.0, I can't find the documentation around 7.*

https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environments?view=azure-devops-rest-6.0

Is your feature request related to a problem? Please describe.

Currently, creating environments via the UI is REALLY painful, and having the ability to create them automatically using the az command would be great (I have managed to get this to work in postman but would be nice to see this supported by the cli)

Describe the solution you'd like

Ability to create and manage azure pipeline environments which back deployment jobs which appear to be a replacement for the old release pipelines which are all UI driven.

Describe alternatives you've considered

Moving away from Azure DevOps as the CD element feels anti-automation.

Additional context

I've been reading the API documentation but the issues raised around it here: https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/526 appear to be ignored and not maintained which leaves little faith in the API documentation produced by Microsoft.

yonzhan commented 2 years ago

route to CXP team

ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @v-anvashist, @V-hmusukula.

Issue Details
**Related command** `az pipelines environments create/delete/update/list` - ability to carry out the actions specified on the API (appears to only be visible on 6.0, I can't find the documentation around 7.* https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environments?view=azure-devops-rest-6.0 **Is your feature request related to a problem? Please describe.** Currently, creating `environments` via the UI is REALLY painful, and having the ability to create them automatically using the `az` command would be great (I have managed to get this to work in postman but would be nice to see this supported by the cli) **Describe the solution you'd like** Ability to create and manage azure pipeline environments which back `deployment` jobs which appear to be a replacement for the old release pipelines which are all UI driven. **Describe alternatives you've considered** Moving away from Azure DevOps as the CD element feels anti-automation. **Additional context** I've been reading the API documentation but the issues raised around it here: https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/526 appear to be ignored and not maintained which leaves little faith in the API documentation produced by Microsoft.
Author: jack1902
Assignees: -
Labels: `Service Attention`, `customer-reported`, `DevOps`, `Pipelines`, `Auto-Assign`
Milestone: -
navba-MSFT commented 2 years ago

Adding Service team to look into this issue.

@v-anvashist, @V-hmusukula Could you please look into this ask and provide an update once you get a chance ?

v-anvashist commented 2 years ago

@jack1902 We are checking the API doc and will share the updates!!

jack1902 commented 2 years ago

Thanks, i've managed to get something working via the APIs within python so that I can create an environment with multiple resources (k8s namespaces) which use a single serviceConnection (it was painful via the UI having to input multiple serviceConnection details when I already had a mechanism for Microsoft to communicate with the cluster)

v-anvashist commented 2 years ago

@jack1902 We have checked the docs and currently we don't have any command support for az pipelines environment.

Below is the doc support for az pipelines

https://docs.microsoft.com/en-us/cli/azure/pipelines?view=azure-cli-latest

jack1902 commented 2 years ago

@v-anvashist i'm aware no support for az pipelines environment exists, hence raising a feature request to look to have it added to better document the API exposed publically which is interacted with via the UI

gitet commented 1 year ago

Thanks, i've managed to get something working via the APIs within python so that I can create an environment with multiple resources (k8s namespaces) which use a single serviceConnection (it was painful via the UI having to input multiple serviceConnection details when I already had a mechanism for Microsoft to communicate with the cluster)

Hi @jack1902 - would you be willing to share the python code you are using to create environments?

jack1902 commented 1 year ago

@gitet - Please find the code here: https://github.com/jack1902/ado-envs

gitet commented 1 year ago

@jack1902 thank you very much!