-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoServiceConnection
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoServiceConnection [string] #ResourceName
{
ProjectName = [String]$ProjectName
ConnectionName = [String]$ConnectionName
ConnectionType = [String]$ConnectionType
[ Description = [String]$Description ]
[ AllowAllPipelines = [Boolean]$AllowAllPipelines ]
[ Authorization = [HashTable]$Authorization ]
[ Data = [HashTable]$Data ]
[ 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.
- ConnectionName: The name of the service connection. This is a key property.
-
ConnectionType: The type of service connection (e.g.,
AzureRM,GitHub,Kubernetes). This is a mandatory property. - Description: An optional description for the service connection.
-
AllowAllPipelines: Whether all pipelines can use this service connection. Defaults to
$false. - Authorization: A hashtable of authorization parameters specific to the connection type.
- Data: A hashtable of additional data parameters specific to the connection type.
-
Ensure: Specifies whether the service connection should exist. Valid values are
PresentandAbsent.
This resource manages service connections in Azure DevOps, enabling pipelines to connect to external services such as Azure subscriptions, GitHub repositories, or Kubernetes clusters.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoServiceConnection AddServiceConnection {
Ensure = 'Present'
ProjectName = 'MyProject'
ConnectionName = 'MyAzureConnection'
ConnectionType = 'AzureRM'
Description = 'Connection to Azure subscription'
AllowAllPipelines = $true
Authorization = @{
tenantId = '00000000-0000-0000-0000-000000000000'
servicePrincipalId = '00000000-0000-0000-0000-000000000001'
authenticationType = 'spnKey'
}
Data = @{
subscriptionId = '00000000-0000-0000-0000-000000000002'
subscriptionName = 'My Azure Subscription'
}
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoServiceConnection
$properties = @{
ProjectName = 'MyProject'
ConnectionName = 'MyAzureConnection'
ConnectionType = 'AzureRM'
}
Invoke-DscResource -Name 'AzDoServiceConnection' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
ConnectionName: MyAzureConnection
}
resources:
- name: Azure Service Connection
type: AzureDevOpsDscNative/AzDoServiceConnection
dependsOn:
- AzureDevOpsDscNative/AzDoProject/MyProject
properties:
ProjectName: $ProjectName
ConnectionName: $ConnectionName
ConnectionType: AzureRM
Description: Connection to Azure subscription
AllowAllPipelines: true
Authorization:
tenantId: '00000000-0000-0000-0000-000000000000'
servicePrincipalId: '00000000-0000-0000-0000-000000000001'
authenticationType: spnKey
Data:
subscriptionId: '00000000-0000-0000-0000-000000000002'
subscriptionName: My Azure Subscription
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