-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoSecurityNamespacePermission
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoSecurityNamespacePermission [string] #ResourceName
{
SecurityNamespace = [String]$SecurityNamespace
Token = [String]$Token
GroupName = [String]$GroupName
[ isInherited = [Boolean]$isInherited ]
[ Permissions = [HashTable[]]$Permissions ]
[ Ensure = [String] {'Present', 'Absent'} ]
}AzDoSecurityNamespacePermission/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'
}AzDoSecurityNamespacePermission/Permissions/Permission
{
PermissionName|PermissionDisplayName = [String]$Name { 'Allow, Deny' }
}Note: Available permissions depend on the
SecurityNamespacespecified. The permission names below are examples from commonly used namespaces. Use the Azure DevOps REST API (/_apis/accesscontrolentries/{namespaceId}) or theaz devops security permission namespace listcommand to retrieve the full list of permissions for a specific namespace.
| Name | DisplayName | Values | Note |
|---|---|---|---|
| ViewBuilds | View builds | [ allow, deny ] | |
| EditBuildQuality | Edit build quality | [ allow, deny ] | |
| RetainIndefinitely | Retain indefinitely | [ allow, deny ] | |
| DeleteBuilds | Delete builds | [ allow, deny ] | |
| QueueBuilds | Queue builds | [ allow, deny ] | |
| StopBuilds | Stop builds | [ allow, deny ] | |
| ViewBuildDefinition | View build pipeline | [ allow, deny ] | |
| EditBuildDefinition | Edit build pipeline | [ allow, deny ] | |
| DeleteBuildDefinition | Delete build pipeline | [ allow, deny ] | |
| AdministerBuildPermissions | Administer build permissions | [ allow, deny ] | Not recommended. |
| Name | DisplayName | Values | Note |
|---|---|---|---|
| GenericRead | Read | [ allow, deny ] | |
| GenericContribute | Contribute | [ allow, deny ] | |
| ForcePush | Force push (rewrite history, delete branches, and files) | [ allow, deny ] | |
| CreateBranch | Create branch | [ allow, deny ] | |
| CreateTag | Create tag | [ allow, deny ] | |
| ManageNote | Manage notes | [ allow, deny ] | |
| PolicyExempt | Bypass policies when pushing | [ allow, deny ] | Not recommended. |
| CreateRepository | Create repository | [ allow, deny ] | |
| DeleteRepository | Delete repository | [ allow, deny ] | Not recommended. |
| ManagePermissions | Manage permissions | [ allow, deny ] | Not recommended. |
| Name | DisplayName | Values | Note |
|---|---|---|---|
| GENERIC_READ | View project-level information | [ allow, deny ] | |
| GENERIC_WRITE | Edit project-level information | [ allow, deny ] | |
| DELETE | Delete team project | [ allow, deny ] | Not recommended. |
| WORK_ITEM_DELETE | Delete and restore work items | [ allow, deny ] | |
| WORK_ITEM_MOVE | Move work items out of this project | [ allow, deny ] | |
| RENAME | Rename team project | [ allow, deny ] | |
| BYPASS_RULES | Bypass rules on work item updates | [ allow, deny ] |
-
SecurityNamespace: The name of the Azure DevOps security namespace (e.g.,
Build,Git Repositories,Project). This property is mandatory and serves as a key property for the resource. - Token: The security token identifying the specific object within the namespace. 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 provides low-level access to Azure DevOps security namespaces, allowing fine-grained permission control over any object in the system. For most use cases, prefer the higher-level permission resources (e.g., AzDoGitPermission, AzDoPipelinePermission). Use this resource when you need to control permissions for namespaces not covered by dedicated resources.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoSecurityNamespacePermission AddNamespacePermission {
Ensure = 'Present'
SecurityNamespace = 'Build'
Token = 'repoV2/00000000-0000-0000-0000-000000000001'
GroupName = '[MyProject]\Contributors'
isInherited = $true
Permissions = @(
@{
Identity = '[MyProject]\Contributors'
Permission = @{
'ViewBuilds' = 'Allow'
'QueueBuilds' = 'Allow'
}
}
)
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoSecurityNamespacePermission
$properties = @{
SecurityNamespace = 'Build'
Token = 'repoV2/00000000-0000-0000-0000-000000000001'
GroupName = '[MyProject]\Contributors'
isInherited = $true
Permissions = @(
@{
Identity = '[MyProject]\Contributors'
Permission = @{
'ViewBuilds' = 'Allow'
}
}
)
}
Invoke-DscResource -Name 'AzDoSecurityNamespacePermission' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
SecurityToken: 'repoV2/00000000-0000-0000-0000-000000000001'
}
resources:
- name: Build Namespace Contributors Permission
type: AzureDevOpsDscNative/AzDoSecurityNamespacePermission
properties:
SecurityNamespace: Build
Token: $SecurityToken
GroupName: '[$ProjectName]\Contributors'
isInherited: true
Permissions:
- Identity: '[$ProjectName]\Contributors'
Permission:
ViewBuilds: Allow
QueueBuilds: 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