-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoRepositorySettings
Michael Zanatta edited this page Aug 19, 2026
·
4 revisions
AzDoRepositorySettings [string] #ResourceName
{
ProjectName = [String]$ProjectName
RepositoryName = [String]$RepositoryName
[ DefaultBranch = [String]$DefaultBranch ]
[ AllowSquashMerge = [Boolean]$AllowSquashMerge ]
[ AllowRebaseMerge = [Boolean]$AllowRebaseMerge ]
[ AllowNoFastForward = [Boolean]$AllowNoFastForward ]
[ DisableForking = [Boolean]$DisableForking ]
[ 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. It cannot be changed after creation.
- RepositoryName: The name of the Git repository. This is a key property. It cannot be changed after creation.
-
DefaultBranch: The default branch name for the repository. Defaults to
main. -
AllowSquashMerge: Whether squash merges are allowed for pull requests. Defaults to
$true. -
AllowRebaseMerge: Whether rebase merges are allowed for pull requests. Defaults to
$true. -
AllowNoFastForward: Whether regular (no-fast-forward) merges are allowed for pull requests. Defaults to
$true. -
DisableForking: Whether forking the repository is disabled. Defaults to
$false. -
Ensure: Specifies whether the settings should be applied. Valid values are
PresentandAbsent.
This resource manages repository-level settings in Azure DevOps Git repositories, including merge strategy restrictions and forking policies. These settings enforce consistent contribution workflows across teams.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoRepositorySettings ConfigureRepoSettings {
Ensure = 'Present'
ProjectName = 'MyProject'
RepositoryName = 'MyRepository'
DefaultBranch = 'main'
AllowSquashMerge = $true
AllowRebaseMerge = $false
AllowNoFastForward = $false
DisableForking = $true
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoRepositorySettings
$properties = @{
ProjectName = 'MyProject'
RepositoryName = 'MyRepository'
}
Invoke-DscResource -Name 'AzDoRepositorySettings' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
RepositoryName: MyRepository
}
resources:
- name: Repository Merge Settings
type: AzureDevOpsDscNative/AzDoRepositorySettings
dependsOn:
- AzureDevOpsDscNative/AzDoGitRepository/MyRepository
properties:
ProjectName: $ProjectName
RepositoryName: $RepositoryName
DefaultBranch: main
AllowSquashMerge: true
AllowRebaseMerge: false
AllowNoFastForward: false
DisableForking: true
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-DscPipelineRunner @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