Skip to content

AzDoVariableGroup

github-actions[bot] edited this page Aug 19, 2026 · 4 revisions

Parameters

Parameter Attribute DataType Description Allowed Values
ProjectName Key System.String
VariableGroupName Required System.String
AllowAccess Write System.Boolean
Description Write System.String
Ensure Write Ensure Present, Absent
VariableGroupType Write System.String Vsts, AzureKeyVault
Variables Write System.Collections.Hashtable
LookupResult Read System.Collections.Hashtable

Description

Examples

Example 1

This example shows how to create a variable group in an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoVariableGroup 'AddAzDoVariableGroup'
        {
            Ensure            = 'Present'
            ProjectName       = 'MyProject'
            VariableGroupName = 'MyVariableGroup'
            Description       = 'Shared pipeline variables'
            VariableGroupType = 'Vsts'
            AllowAccess       = $true
            Variables         = @{
                APP_ENV        = 'production'
                APP_LOG_LEVEL  = 'warn'
            }
        }
    }
}

Example 2

This example shows how to update a variable group in an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoVariableGroup 'UpdateAzDoVariableGroup'
        {
            Ensure            = 'Present'
            ProjectName       = 'MyProject'
            VariableGroupName = 'MyVariableGroup'
            Description       = 'Shared pipeline variables - updated'
            VariableGroupType = 'Vsts'
            AllowAccess       = $true
            Variables         = @{
                APP_ENV        = 'production'
                APP_LOG_LEVEL  = 'info'
                APP_VERSION    = '2.0.0'
            }
        }
    }
}

Example 3

This example shows how to remove a variable group from an Azure DevOps project.

Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'

    node localhost
    {
        AzDoVariableGroup 'RemoveAzDoVariableGroup'
        {
            Ensure            = 'Absent'
            ProjectName       = 'MyProject'
            VariableGroupName = 'MyVariableGroup'
        }
    }
}

Commands

Resources

Clone this wiki locally