-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoVariableGroup
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoVariableGroup [string] #ResourceName
{
ProjectName = [String]$ProjectName
VariableGroupName = [String]$VariableGroupName
[ Description = [String]$Description ]
[ VariableGroupType = [String] {'Vsts', 'AzureKeyVault'} ]
[ Variables = [HashTable]$Variables ]
[ AllowAccess = [Boolean]$AllowAccess ]
[ 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.
- VariableGroupName: The name of the variable group. This is a key property.
- Description: An optional description for the variable group.
-
VariableGroupType: The type of variable group. Valid values are
Vsts(standard) andAzureKeyVault. Defaults toVsts. - Variables: A hashtable of key-value pairs representing the variables.
-
AllowAccess: Whether all pipelines can access this variable group. Defaults to
$false. -
Ensure: Specifies whether the variable group should exist. Valid values are
PresentandAbsent.
This resource manages variable groups in Azure DevOps, allowing shared variables and secrets to be used across multiple pipelines within a project.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoVariableGroup AddVariableGroup {
Ensure = 'Present'
ProjectName = 'MyProject'
VariableGroupName = 'MyVariableGroup'
Description = 'Shared pipeline variables'
VariableGroupType = 'Vsts'
AllowAccess = $true
Variables = @{
APP_ENV = 'production'
APP_LOG_LEVEL = 'warn'
}
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoVariableGroup
$properties = @{
ProjectName = 'MyProject'
VariableGroupName = 'MyVariableGroup'
}
Invoke-DscResource -Name 'AzDoVariableGroup' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject,
VariableGroupName: MyVariableGroup
}
resources:
- name: My Variable Group
type: AzureDevOpsDscNative/AzDoVariableGroup
dependsOn:
- AzureDevOpsDscNative/AzDoProject/MyProject
properties:
ProjectName: $ProjectName
VariableGroupName: $VariableGroupName
Description: Shared pipeline variables
VariableGroupType: Vsts
AllowAccess: true
Variables:
APP_ENV: production
APP_LOG_LEVEL: warn
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