1. Packages
  2. AzureDevOps
  3. API Docs
  4. getGroup
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

azuredevops.getGroup

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

    Use this data source to access information about an existing Group within Azure DevOps

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = azuredevops.getProject({
        name: "Example Project",
    });
    const exampleGetGroup = example.then(example => azuredevops.getGroup({
        projectId: example.id,
        name: "Example Group",
    }));
    export const groupId = exampleGetGroup.then(exampleGetGroup => exampleGetGroup.id);
    export const groupDescriptor = exampleGetGroup.then(exampleGetGroup => exampleGetGroup.descriptor);
    const example-collection-group = azuredevops.getGroup({
        name: "Project Collection Administrators",
    });
    export const collectionGroupId = exampleGetGroup.then(exampleGetGroup => exampleGetGroup.id);
    export const collectionGroupDescriptor = exampleGetGroup.then(exampleGetGroup => exampleGetGroup.descriptor);
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.get_project(name="Example Project")
    example_get_group = azuredevops.get_group(project_id=example.id,
        name="Example Group")
    pulumi.export("groupId", example_get_group.id)
    pulumi.export("groupDescriptor", example_get_group.descriptor)
    example_collection_group = azuredevops.get_group(name="Project Collection Administrators")
    pulumi.export("collectionGroupId", example_get_group.id)
    pulumi.export("collectionGroupDescriptor", example_get_group.descriptor)
    
    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
    		}
    		exampleGetGroup, err := azuredevops.LookupGroup(ctx, &azuredevops.LookupGroupArgs{
    			ProjectId: pulumi.StringRef(example.Id),
    			Name:      "Example Group",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("groupId", exampleGetGroup.Id)
    		ctx.Export("groupDescriptor", exampleGetGroup.Descriptor)
    		_, err = azuredevops.LookupGroup(ctx, &azuredevops.LookupGroupArgs{
    			Name: "Project Collection Administrators",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("collectionGroupId", exampleGetGroup.Id)
    		ctx.Export("collectionGroupDescriptor", exampleGetGroup.Descriptor)
    		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 exampleGetGroup = AzureDevOps.GetGroup.Invoke(new()
        {
            ProjectId = example.Apply(getProjectResult => getProjectResult.Id),
            Name = "Example Group",
        });
    
        var example_collection_group = AzureDevOps.GetGroup.Invoke(new()
        {
            Name = "Project Collection Administrators",
        });
    
        return new Dictionary<string, object?>
        {
            ["groupId"] = exampleGetGroup.Apply(getGroupResult => getGroupResult.Id),
            ["groupDescriptor"] = exampleGetGroup.Apply(getGroupResult => getGroupResult.Descriptor),
            ["collectionGroupId"] = exampleGetGroup.Apply(getGroupResult => getGroupResult.Id),
            ["collectionGroupDescriptor"] = exampleGetGroup.Apply(getGroupResult => getGroupResult.Descriptor),
        };
    });
    
    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.GetGroupArgs;
    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 exampleGetGroup = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
                .projectId(example.applyValue(getProjectResult -> getProjectResult.id()))
                .name("Example Group")
                .build());
    
            ctx.export("groupId", exampleGetGroup.applyValue(getGroupResult -> getGroupResult.id()));
            ctx.export("groupDescriptor", exampleGetGroup.applyValue(getGroupResult -> getGroupResult.descriptor()));
            final var example-collection-group = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
                .name("Project Collection Administrators")
                .build());
    
            ctx.export("collectionGroupId", exampleGetGroup.applyValue(getGroupResult -> getGroupResult.id()));
            ctx.export("collectionGroupDescriptor", exampleGetGroup.applyValue(getGroupResult -> getGroupResult.descriptor()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azuredevops:getProject
          Arguments:
            name: Example Project
      exampleGetGroup:
        fn::invoke:
          Function: azuredevops:getGroup
          Arguments:
            projectId: ${example.id}
            name: Example Group
      example-collection-group:
        fn::invoke:
          Function: azuredevops:getGroup
          Arguments:
            name: Project Collection Administrators
    outputs:
      groupId: ${exampleGetGroup.id}
      groupDescriptor: ${exampleGetGroup.descriptor}
      collectionGroupId: ${exampleGetGroup.id}
      collectionGroupDescriptor: ${exampleGetGroup.descriptor}
    

    PAT Permissions Required

    • Graph: Read
    • Work Items: Read

    Using getGroup

    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 getGroup(args: GetGroupArgs, opts?: InvokeOptions): Promise<GetGroupResult>
    function getGroupOutput(args: GetGroupOutputArgs, opts?: InvokeOptions): Output<GetGroupResult>
    def get_group(name: Optional[str] = None,
                  project_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetGroupResult
    def get_group_output(name: Optional[pulumi.Input[str]] = None,
                  project_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetGroupResult]
    func LookupGroup(ctx *Context, args *LookupGroupArgs, opts ...InvokeOption) (*LookupGroupResult, error)
    func LookupGroupOutput(ctx *Context, args *LookupGroupOutputArgs, opts ...InvokeOption) LookupGroupResultOutput

    > Note: This function is named LookupGroup in the Go SDK.

    public static class GetGroup 
    {
        public static Task<GetGroupResult> InvokeAsync(GetGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupResult> Invoke(GetGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupResult> getGroup(GetGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuredevops:index/getGroup:getGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The Group Name.
    ProjectId string
    The Project ID. If no project ID is specified the project collection groups will be searched.
    Name string
    The Group Name.
    ProjectId string
    The Project ID. If no project ID is specified the project collection groups will be searched.
    name String
    The Group Name.
    projectId String
    The Project ID. If no project ID is specified the project collection groups will be searched.
    name string
    The Group Name.
    projectId string
    The Project ID. If no project ID is specified the project collection groups will be searched.
    name str
    The Group Name.
    project_id str
    The Project ID. If no project ID is specified the project collection groups will be searched.
    name String
    The Group Name.
    projectId String
    The Project ID. If no project ID is specified the project collection groups will be searched.

    getGroup Result

    The following output properties are available:

    Descriptor string
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Origin string
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    OriginId string
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    ProjectId string
    Descriptor string
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Origin string
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    OriginId string
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    ProjectId string
    descriptor String
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    origin String
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    originId String
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    projectId String
    descriptor string
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    origin string
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    originId string
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    projectId string
    descriptor str
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    origin str
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    origin_id str
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    project_id str
    descriptor String
    The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    origin String
    The type of source provider for the origin identifier (ex:AD, AAD, MSA)
    originId String
    The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
    projectId String

    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.1.1 published on Monday, May 20, 2024 by Pulumi