en-US/about_AzDoServiceConnection.help.txt

.NAME
    AzDoServiceConnection
 
.SYNOPSIS
    DSC resource for managing Azure DevOps service connections.
 
.DESCRIPTION
    This resource manages service connections in Azure DevOps, enabling pipelines to connect to
    external services such as Azure subscriptions, GitHub repositories, or Kubernetes clusters.
 
.PARAMETER ProjectName
    Key - System.String
    The name of the Azure DevOps project. This property is mandatory and serves as a key property for the resource.
 
.PARAMETER ConnectionName
    Required - System.String
    The name of the service connection. This is a key property.
 
.PARAMETER ConnectionType
    Required - System.String
    The type of service connection (e.g., AzureRM, GitHub, Kubernetes). This is a mandatory property.
 
.PARAMETER Description
    Write - System.String
    An optional description for the service connection.
 
.PARAMETER AllowAllPipelines
    Write - System.Boolean
    Whether all pipelines can use this service connection. Defaults to $false.
 
.PARAMETER Authorization
    Write - HashTable
    A hashtable of authorization parameters specific to the connection type.
 
.PARAMETER Data
    Write - HashTable
    A hashtable of additional data parameters specific to the connection type.
 
.PARAMETER SharedWithProjects
    Write - System.String[]
    Additional projects, beyond ProjectName, that the service connection is also shared with.
    Compared only when the configuration states it, so a connection shared by hand outside this
    resource is left alone. Add and remove drift against the live
    'serviceEndpointProjectReferences' is detected and corrected by Set.
 
.PARAMETER SharedNameOverrides
    Write - HashTable
    Optional hashtable of ProjectName -> the name the service connection is shown under in that
    project, e.g. @{ Fabrikam = 'shared-azure-sub' }. Only consulted for projects named in
    SharedWithProjects; the owning project's reference always uses ConnectionName.
 
.EXAMPLE 1
 
This example shows how to create an Azure Resource Manager service connection in an Azure DevOps project.
 
Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'
 
    node localhost
    {
        AzDoServiceConnection 'AddAzDoServiceConnection'
        {
            Ensure = 'Present'
            ProjectName = 'MyProject'
            ConnectionName = 'MyAzureServiceConnection'
            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'
            }
        }
    }
}
 
.EXAMPLE 2
 
This example shows how to update an existing service connection in an Azure DevOps project.
 
Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'
 
    node localhost
    {
        AzDoServiceConnection 'UpdateAzDoServiceConnection'
        {
            Ensure = 'Present'
            ProjectName = 'MyProject'
            ConnectionName = 'MyAzureServiceConnection'
            ConnectionType = 'AzureRM'
            Description = 'Connection to Azure subscription - updated'
            AllowAllPipelines = $false
            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'
            }
        }
    }
}
 
.EXAMPLE 3
 
This example shows how to remove a service connection from an Azure DevOps project.
 
Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'
 
    node localhost
    {
        AzDoServiceConnection 'RemoveAzDoServiceConnection'
        {
            Ensure = 'Absent'
            ProjectName = 'MyProject'
            ConnectionName = 'MyAzureServiceConnection'
            ConnectionType = 'AzureRM'
        }
    }
}