-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoEnvironmentPermission
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoEnvironmentPermission [string] #ResourceName
{
ProjectName = [String]$ProjectName
EnvironmentName = [String]$EnvironmentName
GroupName = [String]$GroupName
[ isInherited = [Boolean]$isInherited ]
[ Permissions = [HashTable[]]$Permissions ]
[ Ensure = [String] {'Present', 'Absent'} ]
}AzDoEnvironmentPermission/Permissions
{
Identity = [String]$Identity # Syntax
# SYNTAX: '[ProjectName | OrganizationName]\ServicePrincipalName, UserPrincipalName, UserDisplayName, GroupDisplayName'
# EXAMPLE: '[TestProject]\UserName@email.com'
# EXAMPLE: '[SampleOrganizationName]\Project Collection Administrators'
Permission = [Hashtable]$Permissions # See 'Permission List'
}AzDoEnvironmentPermission/Permissions/Permission
{
PermissionName|PermissionDisplayName = [String]$Name { 'Allow, Deny' }
}Either 'Name' or 'DisplayName' can be used, but we Strongly Recommend that you use 'Name' in your configuration.
| Name | DisplayName | Values | Note |
|---|---|---|---|
| View | View environment | [ allow, deny ] | |
| Manage | Manage environment | [ allow, deny ] | |
| Use | Use environment in pipelines | [ allow, deny ] | |
| Administer | Administer environment | [ allow, deny ] | Not recommended. |
- 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.
-
GroupName: The name of the group to grant permissions to. This is a key property. Use the format
[ProjectName]\GroupName. -
isInherited: Whether permissions are inherited. Defaults to
$true. - Permissions: A HashTable that specifies the permissions to be set. Refer to: 'Permissions Syntax'.
-
Ensure: Specifies whether the permissions should exist. Valid values are
PresentandAbsent.
This resource manages security permissions on Azure DevOps pipeline environments, controlling which groups or users can view, use, or administer specific environments.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoEnvironmentPermission AddEnvironmentPermission {
Ensure = 'Present'
ProjectName = 'MyProject'
EnvironmentName = 'Production'
GroupName = '[MyProject]\Contributors'
isInherited = $true
Permissions = @(
@{
Identity = '[MyProject]\Contributors'
Permission = @{
'View' = 'Allow'
'Use' = 'Allow'
}
}
)
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoEnvironmentPermission
$properties = @{
ProjectName = 'MyProject'
EnvironmentName = 'Production'
GroupName = '[MyProject]\Contributors'
isInherited = $true
Permissions = @(
@{
Identity = '[MyProject]\Contributors'
Permission = @{
'View' = 'Allow'
'Use' = 'Allow'
}
}
)
}
Invoke-DscResource -Name 'AzDoEnvironmentPermission' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
EnvironmentName: Production
}
resources:
- name: Production Environment Contributors Permission
type: AzureDevOpsDscNative/AzDoEnvironmentPermission
dependsOn:
- AzureDevOpsDscNative/AzDoPipelineEnvironment/Production
properties:
ProjectName: $ProjectName
EnvironmentName: $EnvironmentName
GroupName: '[$ProjectName]\Contributors'
isInherited: true
Permissions:
- Identity: '[$ProjectName]\Contributors'
Permission:
View: Allow
Use: Allow
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