Skip to content

AzDoEnvironmentApproval

github-actions[bot] edited this page Aug 19, 2026 · 4 revisions

Parameters

Parameter Attribute DataType Description Allowed Values
ProjectName Key System.String
Approvers Required System.String[]
EnvironmentName Required System.String
AllowApproverToSelf Write System.Boolean
Ensure Write Ensure Present, Absent
Instructions Write System.String
RequiredApproverCount Write System.UInt32
TimeoutInMinutes Write System.UInt32
LookupResult Read System.Collections.Hashtable

Description

Examples

Example 1

This example shows how to configure approval gates on a pipeline environment in an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoEnvironmentApproval 'AddAzDoEnvironmentApproval'
        {
            Ensure                = 'Present'
            ProjectName           = 'MyProject'
            EnvironmentName       = 'Production'
            Approvers             = @('approver@example.com')
            RequiredApproverCount = 1
            AllowApproverToSelf   = $false
            TimeoutInMinutes      = 1440
            Instructions          = 'Please review and approve the production deployment.'
        }
    }
}

Example 2

This example shows how to update approval gates on a pipeline environment in an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoEnvironmentApproval 'UpdateAzDoEnvironmentApproval'
        {
            Ensure                = 'Present'
            ProjectName           = 'MyProject'
            EnvironmentName       = 'Production'
            Approvers             = @('approver1@example.com', 'approver2@example.com')
            RequiredApproverCount = 2
            AllowApproverToSelf   = $false
            TimeoutInMinutes      = 2880
            Instructions          = 'At least 2 approvals required for production deployments.'
        }
    }
}

Example 3

This example shows how to remove approval gates from a pipeline environment in an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoEnvironmentApproval 'RemoveAzDoEnvironmentApproval'
        {
            Ensure          = 'Absent'
            ProjectName     = 'MyProject'
            EnvironmentName = 'Production'
            Approvers       = @()
        }
    }
}

Commands

Resources

Clone this wiki locally