Azure DevOps v3.8.0 published on Monday, Mar 17, 2025 by Pulumi
azuredevops.getVariableGroup
Explore with Pulumi AI
Use this data source to access information about existing Variable Groups within Azure DevOps.
Note: Secret values are masked by service and cannot be obtained through API. Set secret variables
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = azuredevops.getProject({
    name: "Example Project",
});
const exampleGetVariableGroup = example.then(example => azuredevops.getVariableGroup({
    projectId: example.id,
    name: "Example Variable Group",
}));
export const id = exampleGetVariableGroup.then(exampleGetVariableGroup => exampleGetVariableGroup.id);
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.get_project(name="Example Project")
example_get_variable_group = azuredevops.get_variable_group(project_id=example.id,
    name="Example Variable Group")
pulumi.export("id", example_get_variable_group.id)
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.LookupProject(ctx, &azuredevops.LookupProjectArgs{
			Name: pulumi.StringRef("Example Project"),
		}, nil)
		if err != nil {
			return err
		}
		exampleGetVariableGroup, err := azuredevops.LookupVariableGroup(ctx, &azuredevops.LookupVariableGroupArgs{
			ProjectId: example.Id,
			Name:      "Example Variable Group",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", exampleGetVariableGroup.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() => 
{
    var example = AzureDevOps.GetProject.Invoke(new()
    {
        Name = "Example Project",
    });
    var exampleGetVariableGroup = AzureDevOps.GetVariableGroup.Invoke(new()
    {
        ProjectId = example.Apply(getProjectResult => getProjectResult.Id),
        Name = "Example Variable Group",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = exampleGetVariableGroup.Apply(getVariableGroupResult => getVariableGroupResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetProjectArgs;
import com.pulumi.azuredevops.inputs.GetVariableGroupArgs;
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) {
        final var example = AzuredevopsFunctions.getProject(GetProjectArgs.builder()
            .name("Example Project")
            .build());
        final var exampleGetVariableGroup = AzuredevopsFunctions.getVariableGroup(GetVariableGroupArgs.builder()
            .projectId(example.applyValue(getProjectResult -> getProjectResult.id()))
            .name("Example Variable Group")
            .build());
        ctx.export("id", exampleGetVariableGroup.applyValue(getVariableGroupResult -> getVariableGroupResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azuredevops:getProject
      arguments:
        name: Example Project
  exampleGetVariableGroup:
    fn::invoke:
      function: azuredevops:getVariableGroup
      arguments:
        projectId: ${example.id}
        name: Example Variable Group
outputs:
  id: ${exampleGetVariableGroup.id}
Relevant Links
Using getVariableGroup
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVariableGroup(args: GetVariableGroupArgs, opts?: InvokeOptions): Promise<GetVariableGroupResult>
function getVariableGroupOutput(args: GetVariableGroupOutputArgs, opts?: InvokeOptions): Output<GetVariableGroupResult>def get_variable_group(name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetVariableGroupResult
def get_variable_group_output(name: Optional[pulumi.Input[str]] = None,
                       project_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetVariableGroupResult]func LookupVariableGroup(ctx *Context, args *LookupVariableGroupArgs, opts ...InvokeOption) (*LookupVariableGroupResult, error)
func LookupVariableGroupOutput(ctx *Context, args *LookupVariableGroupOutputArgs, opts ...InvokeOption) LookupVariableGroupResultOutput> Note: This function is named LookupVariableGroup in the Go SDK.
public static class GetVariableGroup 
{
    public static Task<GetVariableGroupResult> InvokeAsync(GetVariableGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetVariableGroupResult> Invoke(GetVariableGroupInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVariableGroupResult> getVariableGroup(GetVariableGroupArgs args, InvokeOptions options)
public static Output<GetVariableGroupResult> getVariableGroup(GetVariableGroupArgs args, InvokeOptions options)
fn::invoke:
  function: azuredevops:index/getVariableGroup:getVariableGroup
  arguments:
    # arguments dictionaryThe following arguments are supported:
- name str
- The name of the Variable Group to retrieve.
- project_id str
- The project ID.
getVariableGroup Result
The following output properties are available:
- AllowAccess bool
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- Description string
- The description of the Variable Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- KeyVaults List<Pulumi.Azure Dev Ops. Outputs. Get Variable Group Key Vault> 
- A list of key_vaultblocks as documented below.
- Name string
- The name of the Azure key vault to link secrets from as variables.
- ProjectId string
- Variables
List<Pulumi.Azure Dev Ops. Outputs. Get Variable Group Variable> 
- One or more variableblocks as documented below.
- AllowAccess bool
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- Description string
- The description of the Variable Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- KeyVaults []GetVariable Group Key Vault 
- A list of key_vaultblocks as documented below.
- Name string
- The name of the Azure key vault to link secrets from as variables.
- ProjectId string
- Variables
[]GetVariable Group Variable 
- One or more variableblocks as documented below.
- allowAccess Boolean
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- description String
- The description of the Variable Group.
- id String
- The provider-assigned unique ID for this managed resource.
- keyVaults List<GetVariable Group Key Vault> 
- A list of key_vaultblocks as documented below.
- name String
- The name of the Azure key vault to link secrets from as variables.
- projectId String
- variables
List<GetVariable Group Variable> 
- One or more variableblocks as documented below.
- allowAccess boolean
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- description string
- The description of the Variable Group.
- id string
- The provider-assigned unique ID for this managed resource.
- keyVaults GetVariable Group Key Vault[] 
- A list of key_vaultblocks as documented below.
- name string
- The name of the Azure key vault to link secrets from as variables.
- projectId string
- variables
GetVariable Group Variable[] 
- One or more variableblocks as documented below.
- allow_access bool
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- description str
- The description of the Variable Group.
- id str
- The provider-assigned unique ID for this managed resource.
- key_vaults Sequence[GetVariable Group Key Vault] 
- A list of key_vaultblocks as documented below.
- name str
- The name of the Azure key vault to link secrets from as variables.
- project_id str
- variables
Sequence[GetVariable Group Variable] 
- One or more variableblocks as documented below.
- allowAccess Boolean
- Boolean that indicate if this Variable Group is shared by all pipelines of this project.
- description String
- The description of the Variable Group.
- id String
- The provider-assigned unique ID for this managed resource.
- keyVaults List<Property Map>
- A list of key_vaultblocks as documented below.
- name String
- The name of the Azure key vault to link secrets from as variables.
- projectId String
- variables List<Property Map>
- One or more variableblocks as documented below.
Supporting Types
GetVariableGroupKeyVault    
- Name string
- The name of the Variable Group to retrieve.
- ServiceEndpoint stringId 
- The id of the Azure subscription endpoint to access the key vault.
- Name string
- The name of the Variable Group to retrieve.
- ServiceEndpoint stringId 
- The id of the Azure subscription endpoint to access the key vault.
- name String
- The name of the Variable Group to retrieve.
- serviceEndpoint StringId 
- The id of the Azure subscription endpoint to access the key vault.
- name string
- The name of the Variable Group to retrieve.
- serviceEndpoint stringId 
- The id of the Azure subscription endpoint to access the key vault.
- name str
- The name of the Variable Group to retrieve.
- service_endpoint_ strid 
- The id of the Azure subscription endpoint to access the key vault.
- name String
- The name of the Variable Group to retrieve.
- serviceEndpoint StringId 
- The id of the Azure subscription endpoint to access the key vault.
GetVariableGroupVariable   
- ContentType string
- Enabled bool
- Expires string
- IsSecret bool
- A boolean flag describing if the variable value is sensitive.
- Name string
- The name of the Variable Group to retrieve.
- SecretValue string
- The secret value of the variable.
- Value string
- The value of the variable.
- ContentType string
- Enabled bool
- Expires string
- IsSecret bool
- A boolean flag describing if the variable value is sensitive.
- Name string
- The name of the Variable Group to retrieve.
- SecretValue string
- The secret value of the variable.
- Value string
- The value of the variable.
- contentType String
- enabled Boolean
- expires String
- isSecret Boolean
- A boolean flag describing if the variable value is sensitive.
- name String
- The name of the Variable Group to retrieve.
- secretValue String
- The secret value of the variable.
- value String
- The value of the variable.
- contentType string
- enabled boolean
- expires string
- isSecret boolean
- A boolean flag describing if the variable value is sensitive.
- name string
- The name of the Variable Group to retrieve.
- secretValue string
- The secret value of the variable.
- value string
- The value of the variable.
- content_type str
- enabled bool
- expires str
- is_secret bool
- A boolean flag describing if the variable value is sensitive.
- name str
- The name of the Variable Group to retrieve.
- secret_value str
- The secret value of the variable.
- value str
- The value of the variable.
- contentType String
- enabled Boolean
- expires String
- isSecret Boolean
- A boolean flag describing if the variable value is sensitive.
- name String
- The name of the Variable Group to retrieve.
- secretValue String
- The secret value of the variable.
- value String
- The value of the variable.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azuredevopsTerraform Provider.