-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoEnvironmentApproval
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoEnvironmentApproval [string] #ResourceName
{
ProjectName = [String]$ProjectName
EnvironmentName = [String]$EnvironmentName
Approvers = [String[]]$Approvers
[ RequiredApproverCount = [UInt32]$RequiredApproverCount ]
[ AllowApproverToSelf = [Boolean]$AllowApproverToSelf ]
[ TimeoutInMinutes = [UInt32]$TimeoutInMinutes ]
[ Instructions = [String]$Instructions ]
[ Ensure = [String] {'Present', 'Absent'} ]
}- ProjectName: The name of the Azure DevOps project. This property is mandatory and serves as a key property for the resource.
- EnvironmentName: The name of the pipeline environment. This is a key property.
- Approvers: An array of user UPNs or group names who must approve deployments. This is a mandatory property.
-
RequiredApproverCount: The minimum number of approvals required. Defaults to
1. -
AllowApproverToSelf: Whether the user who triggered the pipeline can approve their own deployment. Defaults to
$false. -
TimeoutInMinutes: How long the approval check waits before timing out. Defaults to
43200(30 days). - Instructions: Instructions shown to approvers. Optional.
-
Ensure: Specifies whether the approval check should exist. Valid values are
PresentandAbsent.
This resource configures approval gates on Azure DevOps pipeline environments. When an approval check is configured, deployments to that environment will pause until the required number of approvers have approved the deployment.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoEnvironmentApproval AddApproval {
Ensure = 'Present'
ProjectName = 'MyProject'
EnvironmentName = 'Production'
Approvers = @('approver@example.com')
RequiredApproverCount = 1
AllowApproverToSelf = $false
TimeoutInMinutes = 1440
Instructions = 'Please review the deployment plan before approving.'
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoEnvironmentApproval
$properties = @{
ProjectName = 'MyProject'
EnvironmentName = 'Production'
Approvers = @('approver@example.com')
}
Invoke-DscResource -Name 'AzDoEnvironmentApproval' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
EnvironmentName: Production
}
resources:
- name: Production Approval Gate
type: AzureDevOpsDscNative/AzDoEnvironmentApproval
dependsOn:
- AzureDevOpsDscNative/AzDoPipelineEnvironment/Production
properties:
ProjectName: $ProjectName
EnvironmentName: $EnvironmentName
Approvers:
- approver@example.com
RequiredApproverCount: 1
AllowApproverToSelf: false
TimeoutInMinutes: 1440
Instructions: Please review the deployment plan before approving.
Ensure: PresentLCM Initialization:
$params = @{
AzureDevopsOrganizationName = "SampleAzDoOrgName"
ConfigurationDirectory = "C:\Datum\DSCOutput\"
ConfigurationUrl = 'https://configuration-path'
JITToken = 'SampleJITToken'
Mode = 'Set'
AuthenticationType = 'ManagedIdentity'
ReportPath = 'C:\Datum\DSCOutput\Reports'
}
Invoke-AzDoLCM @params- Assert-BoundParameter
- Assert-ElevatedUser
- Assert-IPAddress
- Assert-Module
- AzDoAPI_0_ProjectCache
- AzDoAPI_1_GroupCache
- AzDoAPI_2_UserCache
- AzDoAPI_3_GroupMemberCache
- AzDoAPI_4_GitRepositoryCache
- AzDoAPI_5_PermissionsCache
- AzDoAPI_6_ServicePrinciple
- AzDoAPI_7_IdentitySubjectDescriptors
- AzDoAPI_8_ProjectProcessTemplates
- AzDoAPI_9_DevOpsClassificationNodes
- Compare-DscParameterState
- Compare-ResourcePropertyState
- ConvertFrom-DscResourceInstance
- ConvertTo-Base64String
- ConvertTo-CimInstance
- ConvertTo-HashTable
- Find-Certificate
- Format-Path
- Get-AzDevOpsOperation
- Get-AzDevOpsServicesApiUri
- Get-AzDevOpsServicesUri
- AzDoAgentPool
- AzDoAgentPoolPermission
- AzDoAgentQueue
- AzDoAreaNodes
- AzDoAreaPermission
- AzDoArtifactFeed
- AzDoArtifactFeedPermission
- AzDoArtifactFeedSettings
- AzDoArtifactFeedView
- AzDoAuditStream
- AzDoBranchPolicy
- AzDoCheckConfiguration
- AzDoDeploymentGroup
- AzDoEnvironmentApproval
- AzDoEnvironmentPermission
- AzDoExtension
- AzDoGitPermission
- AzDoGitRepository
- AzDoGroupMember
- AzDoGroupPermission
- AzDoIterationNodes
- AzDoIterationPermission
- AzDoNotificationSubscription
- AzDoOrganizationGroup
- AzDoOrganizationSettings
- AzDoPipeline
- AzDoPipelineEnvironment
- AzDoPipelinePermission
- AzDoPipelineSettings
- AzDoProcess
- AzDoProcessPermission
- AzDoProject
- AzDoProjectGroup
- AzDoProjectPermission
- AzDoProjectServices
- AzDoRepositorySettings
- AzDoSecurityNamespacePermission
- AzDoServiceConnection
- AzDoServiceConnectionPermission
- AzDoServiceHook
- AzDoTaskGroup
- AzDoTeam
- AzDoTeamMember
- AzDoTeamSettings
- AzDoUserEntitlement
- AzDoVariableGroup
- AzDoVariableGroupPermission
- AzDoWiki
- AzDoWIPTags