en-US/about_AzDoVariableGroup.help.txt
|
.NAME
AzDoVariableGroup .SYNOPSIS DSC resource for managing Azure DevOps pipeline variable groups. .DESCRIPTION This resource manages variable groups in Azure DevOps, allowing shared variables and secrets to be used across multiple pipelines within a project. .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 VariableGroupName Required - System.String The name of the variable group. This is a key property. .PARAMETER Description Write - System.String An optional description for the variable group. .PARAMETER VariableGroupType Write - System.String Allowed values: Vsts, AzureKeyVault The type of variable group. Valid values are Vsts (standard) and AzureKeyVault. Defaults to Vsts. .PARAMETER Variables Write - HashTable The variables of the group, keyed by variable name. Each entry is either a plain string value (a non-secret variable) or a hashtable with 'value' and 'isSecret' (key names are not case sensitive): Variables = @{ APP_ENV = 'production' APPAPIKEY = @{ value = 'p@ssw0rd'; isSecret = $true } } A secret variable is stored encrypted by Azure DevOps and can never be read back, so Test only checks that it exists and is secret - a changed secret value is not detected as drift. Its value is written when the configuration supplies one; '@{ isSecret = $true }' with no value keeps the value already stored. When Variables is specified it is the complete set: a variable that is not listed is removed on Set. When it is not specified the live variables are left alone. .PARAMETER AllowAccess Write - System.Boolean Whether all pipelines can access this variable group. Defaults to $false. .EXAMPLE 1 This example shows how to create a variable group in an Azure DevOps project. A variable is a plain string (non-secret), or a hashtable with 'value' and 'isSecret'. A secret variable is stored encrypted and can never be read back; Test only checks that it exists and is secret. Supply the secret from a secure source (a parameter, a vault) - never commit it into a configuration file. Configuration Example { param ( [Parameter(Mandatory = $true)] [System.String]$AppApiKey ) 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' APP_API_KEY = @{ value = $AppApiKey; isSecret = $true } } } } } .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' } } } |