'Azure DevOps REST API, retrieve current environment status
We have a small development/testing environment setup on Azure VMs that only run during business hours. Sometimes one of our Devs may complete a PR after hours. This generally results in a failed build/deployment as the Azure VMs are shutdown.
For a different project that utilises the Classic Release and Deployment Groups, I have a PowerShell script that checks the Azure VMs and starts them if they're shutdown. (this is done via the DeploymentGroups API
I'm currently setting up some new pipelines using YAML where the deployments utilise environments for approvals, etc... These new pipelines are running without any problems and provide a clearer picture of our overall build/release process.
One thing I haven't been able to determine is how to check the status of the Environment prior to commencing a deployment job. The Environment API documentation doesn't show any status items. And of course I don't see anything in the returned object.
Open to options on how to check the status, then subsequently start and stop the VMs as required during the deployment process.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|