Skip to content

Latest commit

 

History

History
104 lines (80 loc) · 2.92 KB

File metadata and controls

104 lines (80 loc) · 2.92 KB

DSC AzDoProjectGroup Resource

Syntax

AzDoProjectGroup [string] #ResourceName
{
    GroupName = [String]$GroupName
    ProjectName = [String]$ProjectName
    [ GroupDescription = [String]$GroupDescription ]
    [ Ensure = [String] {'Present', 'Absent'} ]
}

Properties

Common Properties

  • GroupName: The name of the project group. This property is mandatory and serves as the key property for the resource.
  • ProjectName: The name of the Azure DevOps project associated with this group. This property is mandatory.
  • GroupDescription: A description of the project group.
  • Ensure: Specifies whether the project group should exist. Defaults to 'Present'.

Additional Information

This resource is used to manage Azure DevOps project groups using Desired State Configuration (DSC). It allows you to define the properties of an Azure DevOps project group and ensures that the group is configured according to those properties.

Examples

Example 1: Sample Configuration using AzDoProjectGroup Resource

Configuration ExampleConfig {
    Import-DscResource -ModuleName 'AzDevOpsDsc'

    Node localhost {
        AzDoProjectGroup ProjectGroup {
            Ensure              = 'Present'
            GroupName           = 'SampleProjectGroup'
            ProjectName         = 'SampleProject'
            GroupDescription    = 'This is a sample project group!'
        }
    }
}

ExampleConfig
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose

Example 2: Sample Configuration using Invoke-DSCResource

# Return the current configuration for AzDoProjectGroup
# Ensure is not required
$properties = @{
    GroupName = 'SampleProjectGroup'
    ProjectName = 'SampleProject'
    GroupDescription = 'This is a sample project group!'
}

Invoke-DSCResource -Name 'AzDoProjectGroup' -Method Get -Property $properties -ModuleName 'AzureDevOpsDsc'

Example 3: Sample Configuration using AzDO-DSC-LCM

parameters: {}

variables: {
   "PlaceHolder2": "PlaceHolder"  
}

resources:
- name: Team Leaders Project Group
  type: AzureDevOpsDsc/AzDoProjectGroup
  properties:
    GroupName: AZDO_TeamLeaders_ProjectGroup
    ProjectName: SampleProject
    GroupDescription: Team Leaders Project Group

- name: Service Accounts Project Group
  type: AzureDevOpsDsc/AzDoProjectGroup
  properties:
    GroupName: AZDO_ServiceAccounts_ProjectGroup
    ProjectName: SampleProject
    GroupDescription: Service Accounts Project Group

LCM 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