Azure DevOps - schedule release deployment is not available - deployment

In Azure DevOps you can schedule a release as many times as possible. In my example, I want to create a release 3 times a day Monday - Friday
But, if I need to actually deploy those releases 3 times a day Monday - Friday, I can't. There is only one slot available and user can't add more.
Is this a limitation of Azure DevOps and how I can actually deploy my release (not create them) 3 times a day?

This is not available at present.
Not sure if totally got your point, what you are looking for is something similar to schedule redeploy.
When you submit a pre-deployment approval for a stage, you can defer the deployment until a specified time. You could not select or specify multiple times here.
You could submit a feature request in Develop Community: https://developercommunity.visualstudio.com/spaces/21/index.html

As Patrick pointed out, this currently isn't possible. You can set multiple schedules for a release but individual stages can't be scheduled more than once. As a workaround, you could clone the stage and then set different schedules for it.

Related

Run Azure Release Pipeline stage if one of many dependent stages runs

We have a rather large deployment surface, say 10 apps that get deployed. For patch releases we sometimes deploy only one app and I'd like to have a stage run either after all 10 are deployed or if only one is deployed. A simplified graph looks like the following. The "Do Something" step will only run if all three app stages run and I don't want to have to duplicate it for each app so looking for a better way. I guess that I could live with it if it just ran one time on any successful dependent stage (doesn't need to wait for all of them).
So I think there are a couple options for this. Will need to look at YAML Multi stage release pipelines. Specifically, deployment jobs
First depending on complexity of the "Do something" stage, it could be a job template and loaded into each of the app stages. I realize you mentioned you don't want it to run every time so this is just an option.
The second option is if the pipeline is being ran adhoc you will have the ability to select which stages are ran. Thus you could manually select the app stages to run and select the "do something stage" It will look something similar to this. The hard part will be working on the dependencies:
I'd assumed you'd want the "do something" to be dependent on the success of one of the previous stages.
Run Azure Release Pipeline stage if one of many dependent stages runs
I am afraidthere is no such out of way to achieve this at this moment.
That is because there is no "OR" syntax for the depend on. And we could not add the condition for the depend on.
You could submit this request condition "OR" to our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps.
As workaround:
The main idea of the solution is: You could try to set depend on for the stage Secure with [], then add a Inline powershell task before other tasks. This task will call the REST API Definitions - Get to monitor whether all the stages in the current release pipeline have inprocess and queue states. If so, wait for 30 seconds, and then loop again until all other stages in the current release pipeline have no inprocess and queue states. Then next execute other tasks will be executed.
You could check my previous ticket for detailed info:

azure devop project stats longer than 30 days?

In azure devop, we can see the project stats, for example this one. But it is only showing upto 30 days activities.
I am wondering if there is a way (maybe some API call) to show activities over a whole year? We area trying to do a end of year report for big boss and would be nice to show how many deployments we done,how many PR were completed etc over the whole year.
By checking the API that it called behind the scenes, you should have something like
https://ORG.visualstudio.com/GUI/_apis/build/Metrics/Daily?minMetricsTime=2021-11-05T13%3A08%3A08.556Z
You can manipulate this value on browser and change the date to an older one for example (2020-12-16)
As I am not working with an Azure Devops repos for long time I cannot test the behavior, but it maybe work.

Can a Self Hosted Agent be set as enabled at certain times?

In Azure DevOps, can an agent be set as enabled or disabled at certain times? This is with self-hosted agents. I know there is the toggle in the UI to turn agents on at off as in the screenshot below. But can the enable and disable be scheduled? I'd like to add a user's machine at the weekend for example to help speed up the tests that are run, but obviously we don't want it running tests while in use Monday to Friday.
There's no option to enable/disable agents by schedule. However, you can try to achieve a similar effect with this approach:
Author a new pipeline with a single agentless job. It can invoke the Azure DevOps REST API to change the status of the agent (enabled/disabled). You can find this answer useful as a starting point.
Define the scheduled trigger the way you'd like your agent to be enabled/disabled.

Azure DevOps scheduled release with approvals

I have a question concerning a release pipeline with both a schedule, as well as approvals.
Right now, the pipeline flows as follows:
A new build is triggered by a merge on our master branch
From the new build, a new release is automatically created
The schedule of this release is to wait until Saturday morning 3 AM to fire
On 3 AM, it sends approval requests for the people in the pipeline
After approval, the release happens
Steps 3, 4 and 5 are in the wrong order for our process. What it actually should do is:
Ask for approval
After approval, schedule the build for a release on Saturday 3 AM
Initiate the release
I can get there by introducing an empty stage that only handles the approval part, and in a next stage handle the deployment per schedule. But that seems like a workaround for something that should be doable in a better way. So am I missing an option here, or is this the way to do it?
#ChamindaC is correct. Your solution to have an Approval Stage that would precede the Scheduled stage is how the ordering of approvals and triggers can be accomplished.
I believe the order of appearance in the per stage Pre-deployment Conditions menu is also the order of execution.

Practical way to automate hourly releases on VSTS

We would like to trigger two of our pipelines hourly. How can we do that other than this part as we want to implement business rules such as do not run if there is an active deployment?
If you want hourly deployments, you'll need to create 24 schedules for each hour and then use the deployment queue setting. You can set the deployment queue settings to a max number of parallel deployments to 1.
For more information check this link