1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. VariableGroupVariable
Azure DevOps v3.12.0 published on Friday, Jan 9, 2026 by Pulumi
azuredevops logo
Azure DevOps v3.12.0 published on Friday, Jan 9, 2026 by Pulumi

    Manages variable group variables within a variable group.

    Note Variable group variables can also be managed inlined in the variable blocks in azuredevops.VariableGroup.

    Example Usage

    Basic usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Pulumi",
    });
    const exampleVariableGroup = new azuredevops.VariableGroup("example", {
        projectId: example.id,
        name: "Example Variable Group",
        description: "Example Variable Group Description",
        allowAccess: true,
        variables: [{
            name: "key1",
            value: "val1",
        }],
    });
    const exampleVariableGroupVariable = new azuredevops.VariableGroupVariable("example", {
        projectId: example.id,
        variableGroupId: exampleVariableGroup.id,
        name: "key2",
        value: "val2",
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Pulumi")
    example_variable_group = azuredevops.VariableGroup("example",
        project_id=example.id,
        name="Example Variable Group",
        description="Example Variable Group Description",
        allow_access=True,
        variables=[{
            "name": "key1",
            "value": "val1",
        }])
    example_variable_group_variable = azuredevops.VariableGroupVariable("example",
        project_id=example.id,
        variable_group_id=example_variable_group.id,
        name="key2",
        value="val2")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Pulumi"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVariableGroup, err := azuredevops.NewVariableGroup(ctx, "example", &azuredevops.VariableGroupArgs{
    			ProjectId:   example.ID(),
    			Name:        pulumi.String("Example Variable Group"),
    			Description: pulumi.String("Example Variable Group Description"),
    			AllowAccess: pulumi.Bool(true),
    			Variables: azuredevops.VariableGroupVariableTypeArray{
    				&azuredevops.VariableGroupVariableTypeArgs{
    					Name:  pulumi.String("key1"),
    					Value: pulumi.String("val1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewVariableGroupVariable(ctx, "example", &azuredevops.VariableGroupVariableArgs{
    			ProjectId:       example.ID(),
    			VariableGroupId: exampleVariableGroup.ID(),
    			Name:            pulumi.String("key2"),
    			Value:           pulumi.String("val2"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Pulumi",
        });
    
        var exampleVariableGroup = new AzureDevOps.VariableGroup("example", new()
        {
            ProjectId = example.Id,
            Name = "Example Variable Group",
            Description = "Example Variable Group Description",
            AllowAccess = true,
            Variables = new[]
            {
                new AzureDevOps.Inputs.VariableGroupVariableArgs
                {
                    Name = "key1",
                    Value = "val1",
                },
            },
        });
    
        var exampleVariableGroupVariable = new AzureDevOps.VariableGroupVariable("example", new()
        {
            ProjectId = example.Id,
            VariableGroupId = exampleVariableGroup.Id,
            Name = "key2",
            Value = "val2",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.VariableGroup;
    import com.pulumi.azuredevops.VariableGroupArgs;
    import com.pulumi.azuredevops.VariableGroupVariable;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Project("example", ProjectArgs.builder()
                .name("Example Project")
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Pulumi")
                .build());
    
            var exampleVariableGroup = new VariableGroup("exampleVariableGroup", VariableGroupArgs.builder()
                .projectId(example.id())
                .name("Example Variable Group")
                .description("Example Variable Group Description")
                .allowAccess(true)
                .variables(VariableGroupVariableArgs.builder()
                    .name("key1")
                    .value("val1")
                    .build())
                .build());
    
            var exampleVariableGroupVariable = new VariableGroupVariable("exampleVariableGroupVariable", VariableGroupVariableArgs.builder()
                .projectId(example.id())
                .variableGroupId(exampleVariableGroup.id())
                .name("key2")
                .value("val2")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Pulumi
      exampleVariableGroup:
        type: azuredevops:VariableGroup
        name: example
        properties:
          projectId: ${example.id}
          name: Example Variable Group
          description: Example Variable Group Description
          allowAccess: true
          variables:
            - name: key1
              value: val1
      exampleVariableGroupVariable:
        type: azuredevops:VariableGroupVariable
        name: example
        properties:
          projectId: ${example.id}
          variableGroupId: ${exampleVariableGroup.id}
          name: key2
          value: val2
    

    PAT Permissions Required

    • Variable Groups: Read, Create, & Manage

    Create VariableGroupVariable Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VariableGroupVariable(name: string, args: VariableGroupVariableArgs, opts?: CustomResourceOptions);
    @overload
    def VariableGroupVariable(resource_name: str,
                              args: VariableGroupVariableInitArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def VariableGroupVariable(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              project_id: Optional[str] = None,
                              variable_group_id: Optional[str] = None,
                              name: Optional[str] = None,
                              secret_value: Optional[str] = None,
                              value: Optional[str] = None)
    func NewVariableGroupVariable(ctx *Context, name string, args VariableGroupVariableArgs, opts ...ResourceOption) (*VariableGroupVariable, error)
    public VariableGroupVariable(string name, VariableGroupVariableArgs args, CustomResourceOptions? opts = null)
    public VariableGroupVariable(String name, VariableGroupVariableArgs args)
    public VariableGroupVariable(String name, VariableGroupVariableArgs args, CustomResourceOptions options)
    
    type: azuredevops:VariableGroupVariable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VariableGroupVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VariableGroupVariableInitArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VariableGroupVariableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VariableGroupVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VariableGroupVariableArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var variableGroupVariableResource = new AzureDevOps.VariableGroupVariable("variableGroupVariableResource", new()
    {
        ProjectId = "string",
        VariableGroupId = "string",
        Name = "string",
        SecretValue = "string",
        Value = "string",
    });
    
    example, err := azuredevops.NewVariableGroupVariable(ctx, "variableGroupVariableResource", &azuredevops.VariableGroupVariableArgs{
    	ProjectId:       pulumi.String("string"),
    	VariableGroupId: pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	SecretValue:     pulumi.String("string"),
    	Value:           pulumi.String("string"),
    })
    
    var variableGroupVariableResource = new VariableGroupVariable("variableGroupVariableResource", VariableGroupVariableArgs.builder()
        .projectId("string")
        .variableGroupId("string")
        .name("string")
        .secretValue("string")
        .value("string")
        .build());
    
    variable_group_variable_resource = azuredevops.VariableGroupVariable("variableGroupVariableResource",
        project_id="string",
        variable_group_id="string",
        name="string",
        secret_value="string",
        value="string")
    
    const variableGroupVariableResource = new azuredevops.VariableGroupVariable("variableGroupVariableResource", {
        projectId: "string",
        variableGroupId: "string",
        name: "string",
        secretValue: "string",
        value: "string",
    });
    
    type: azuredevops:VariableGroupVariable
    properties:
        name: string
        projectId: string
        secretValue: string
        value: string
        variableGroupId: string
    

    VariableGroupVariable Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VariableGroupVariable resource accepts the following input properties:

    ProjectId string
    The ID of the project.
    VariableGroupId string
    The ID of the variable group.
    Name string
    The name of the variable. Must be unique within the Variable Group.
    SecretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    Value string
    The value of the variable.
    ProjectId string
    The ID of the project.
    VariableGroupId string
    The ID of the variable group.
    Name string
    The name of the variable. Must be unique within the Variable Group.
    SecretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    Value string
    The value of the variable.
    projectId String
    The ID of the project.
    variableGroupId String
    The ID of the variable group.
    name String
    The name of the variable. Must be unique within the Variable Group.
    secretValue String

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value String
    The value of the variable.
    projectId string
    The ID of the project.
    variableGroupId string
    The ID of the variable group.
    name string
    The name of the variable. Must be unique within the Variable Group.
    secretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value string
    The value of the variable.
    project_id str
    The ID of the project.
    variable_group_id str
    The ID of the variable group.
    name str
    The name of the variable. Must be unique within the Variable Group.
    secret_value str

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value str
    The value of the variable.
    projectId String
    The ID of the project.
    variableGroupId String
    The ID of the variable group.
    name String
    The name of the variable. Must be unique within the Variable Group.
    secretValue String

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value String
    The value of the variable.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VariableGroupVariable resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VariableGroupVariable Resource

    Get an existing VariableGroupVariable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VariableGroupVariableState, opts?: CustomResourceOptions): VariableGroupVariable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            secret_value: Optional[str] = None,
            value: Optional[str] = None,
            variable_group_id: Optional[str] = None) -> VariableGroupVariable
    func GetVariableGroupVariable(ctx *Context, name string, id IDInput, state *VariableGroupVariableState, opts ...ResourceOption) (*VariableGroupVariable, error)
    public static VariableGroupVariable Get(string name, Input<string> id, VariableGroupVariableState? state, CustomResourceOptions? opts = null)
    public static VariableGroupVariable get(String name, Output<String> id, VariableGroupVariableState state, CustomResourceOptions options)
    resources:  _:    type: azuredevops:VariableGroupVariable    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Name string
    The name of the variable. Must be unique within the Variable Group.
    ProjectId string
    The ID of the project.
    SecretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    Value string
    The value of the variable.
    VariableGroupId string
    The ID of the variable group.
    Name string
    The name of the variable. Must be unique within the Variable Group.
    ProjectId string
    The ID of the project.
    SecretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    Value string
    The value of the variable.
    VariableGroupId string
    The ID of the variable group.
    name String
    The name of the variable. Must be unique within the Variable Group.
    projectId String
    The ID of the project.
    secretValue String

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value String
    The value of the variable.
    variableGroupId String
    The ID of the variable group.
    name string
    The name of the variable. Must be unique within the Variable Group.
    projectId string
    The ID of the project.
    secretValue string

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value string
    The value of the variable.
    variableGroupId string
    The ID of the variable group.
    name str
    The name of the variable. Must be unique within the Variable Group.
    project_id str
    The ID of the project.
    secret_value str

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value str
    The value of the variable.
    variable_group_id str
    The ID of the variable group.
    name String
    The name of the variable. Must be unique within the Variable Group.
    projectId String
    The ID of the project.
    secretValue String

    The value of the secret variable.

    NOTE Exactly one of value and secret_value must be specified.

    value String
    The value of the variable.
    variableGroupId String
    The ID of the variable group.

    Import

    Secret variable cannot be imported.

    Azure DevOps Variable group variables can be imported using the project ID/variable group ID/variable name, e.g.

    $ pulumi import azuredevops:index/variableGroupVariable:VariableGroupVariable example 00000000-0000-0000-0000-000000000000/0/key1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.12.0 published on Friday, Jan 9, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate