-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoAreaNodes
The AzDoAreaNodes DSC resource is used to manage area nodes (also called area paths) within an Azure DevOps project. Areas are used to organize and track work items by functional areas or teams, enabling better categorization and filtering of work across the project.
AzDoAreaNodes [string] #ResourceName
{
ProjectName = [String] $ProjectName
[ AreaPaths = [String[]] $AreaPaths ]
[ Ensure = [String] {'Present', 'Absent'} ]
[ DependsOn = [String[]] ]
[ PsDscRunAsCredential = [PSCredential] ]
}- ProjectName [String] - The name of the Azure DevOps project.
-
AreaPaths [String[]] - An array of area path strings to create or manage (e.g., @('Frontend', 'Backend', 'DevOps')).
-
Ensure [String] - Desired state of the resource:
-
'Present'- (default) Area paths should exist -
'Absent'- Area paths should be removed
-
-
DependsOn [String[]] - Dependencies on other resources. Use this to control the order of resource execution.
-
PsDscRunAsCredential [PSCredential] - Credentials to run this resource under.
The resource returns the following properties:
- ProjectName - The name of the project
- AreaPaths - The list of area paths that exist or are configured
- Ensure - Current state ('Present' or 'Absent')
Configuration CreateBasicAreas {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoAreaNodes 'ProjectAreas' {
ProjectName = 'MyProject'
AreaPaths = @(
'Frontend',
'Backend',
'DevOps',
'Documentation'
)
Ensure = 'Present'
}
}
}
CreateBasicAreas
Start-DscConfiguration -Path ./CreateBasicAreas -Wait -VerboseConfiguration CreateHierarchicalAreas {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoAreaNodes 'TeamAreas' {
ProjectName = 'MyProject'
AreaPaths = @(
'Platform',
'Platform\Backend',
'Platform\Backend\APIs',
'Platform\Backend\Services',
'Platform\Frontend',
'Platform\Frontend\Web',
'Platform\Frontend\Mobile'
)
Ensure = 'Present'
}
}
}
CreateHierarchicalAreas
Start-DscConfiguration -Path ./CreateHierarchicalAreas -Wait -VerboseConfiguration OrganizationalAreas {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoAreaNodes 'OrgAreas' {
ProjectName = 'EnterprisePlatform'
AreaPaths = @(
'Engineering\Development',
'Engineering\QA',
'Engineering\DevOps',
'Infrastructure\Cloud',
'Infrastructure\On-Premises',
'Operations\Support',
'Operations\Monitoring'
)
Ensure = 'Present'
}
}
}
OrganizationalAreas
Start-DscConfiguration -Path ./OrganizationalAreas -Wait -Verbose# Get the current state of areas
$properties = @{
ProjectName = 'MyProject'
}
$result = Invoke-DscResource -Name 'AzDoAreaNodes' `
-Method Get `
-Property $properties `
-ModuleName 'AzureDevOpsDscNative'
$result | Select-Object ProjectName, AreaPaths, EnsureConfiguration CreateProjectWithAreas {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoProject 'MyProject' {
ProjectName = 'MyProject'
Ensure = 'Present'
SourceControlType = 'Git'
ProcessTemplate = 'Agile'
}
AzDoAreaNodes 'ProjectAreas' {
ProjectName = 'MyProject'
AreaPaths = @(
'Frontend',
'Backend',
'QA',
'DevOps'
)
Ensure = 'Present'
DependsOn = '[AzDoProject]MyProject'
}
}
}
CreateProjectWithAreas
Start-DscConfiguration -Path ./CreateProjectWithAreas -Wait -VerboseConfiguration UpdateAreaStructure {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoAreaNodes 'UpdatedAreas' {
ProjectName = 'MyProject'
AreaPaths = @(
'Frontend',
'Backend',
'Backend\APIs',
'Backend\Services',
'QA',
'DevOps',
'Security'
)
Ensure = 'Present'
}
}
}
UpdateAreaStructure
Start-DscConfiguration -Path ./UpdateAreaStructure -Wait -VerboseConfiguration RemoveAreas {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoAreaNodes 'RemoveUnused' {
ProjectName = 'MyProject'
AreaPaths = @('LegacyArea', 'DeprecatedArea')
Ensure = 'Absent'
}
}
}
RemoveAreas
Start-DscConfiguration -Path ./RemoveAreas -Wait -Verbose- Area paths use backslash as separator (e.g., 'Parent\Child')
- Paths are case-insensitive for matching but case-sensitive for display
- Path depth is typically limited by project settings
- Areas form a tree structure within the project
- Child areas inherit permissions from parents
- Areas can be used for organizing work items and permissions
- Plan area structure early in project setup
- Use meaningful names that reflect organizational structure
- Keep hierarchy reasonably flat (2-3 levels deep)
- Document area purposes for team members
- Creating areas does not affect existing work items
- Removing areas may require reassigning work items first
- Areas are commonly used with iterations for sprint planning
Cause: The specified project does not exist
Solution:
# Verify the project name matches exactly
# Ensure the project exists before creating areas
# Use AzDoProject resource to create the project firstCause: Invalid path format or parent area doesn't exist
Solution:
- Verify path format uses backslash as separator
- Ensure parent areas exist before creating child areas
- Check for special characters in area names
Cause: Caching or incomplete configuration
Solution:
# Refresh the work item tracking database
# Reload Azure DevOps UI in browser
# Verify areas were created successfully- AzDoProject - Create and manage Azure DevOps projects
- AzDoAreaPermission - Manage area-level permissions
- AzDoIterationNodes - Manage iteration nodes (sprints)
- AzDoWIPTags - Configure work-in-progress tags