I have the release pipeline and I would like to set the approval on the task level.
For example: I have the below powershell tasks and each of the task should have approve or disapprove to execute. if I dissaprove or approve SetupDatabricks
task it still has to go to next task. The approval or dissaporval should not have the impact if next task should run or no (they should run).
In Azure DevOps, approvals are not set at the task level but can be configured at the stage level or between jobs with a manual intervention task.
However, if you disapprove a stage or reject the manual intervention task, it will not go to next task as the pipeline is in a failed/rejected state.
As you want the approval or disapproval should not have the impact if next task should run or no (they should run), you can try the following steps. With this workaround, we can control if the task is approved to run when you manually create a new release. The disadvantage is that you can't change the approvals state when the release is running.
$aproveSetupDatabricks = $env:aproveSetupDatabricks
if ($aproveSetupDatabricks -eq "true") {
Write-Host "approve SetupDatabricks"
# Write your commands here.
} else {
Write-Host "disapprove SetupDatabricks"
}