azuredevops logo
Azure DevOps v2.7.0, Mar 27 23

azuredevops.getTeam

Explore with Pulumi AI

Use this data source to access information about an existing Team in a Project within Azure DevOps.

PAT Permissions Required

  • vso.project: Grants the ability to read projects and teams.

Example Usage

using System.Collections.Generic;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var exampleProject = new AzureDevOps.Project("exampleProject", new()
    {
        WorkItemTemplate = "Agile",
        VersionControl = "Git",
        Visibility = "private",
        Description = "Managed by Terraform",
    });

    var exampleTeam = AzureDevOps.GetTeam.Invoke(new()
    {
        ProjectId = exampleProject.Id,
        Name = "Example Project Team",
    });

});
package main

import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
			WorkItemTemplate: pulumi.String("Agile"),
			VersionControl:   pulumi.String("Git"),
			Visibility:       pulumi.String("private"),
			Description:      pulumi.String("Managed by Terraform"),
		})
		if err != nil {
			return err
		}
		_ = azuredevops.LookupTeamOutput(ctx, azuredevops.GetTeamOutputArgs{
			ProjectId: exampleProject.ID(),
			Name:      pulumi.String("Example Project Team"),
		}, nil)
		return nil
	})
}
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.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetTeamArgs;
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 exampleProject = new Project("exampleProject", ProjectArgs.builder()        
            .workItemTemplate("Agile")
            .versionControl("Git")
            .visibility("private")
            .description("Managed by Terraform")
            .build());

        final var exampleTeam = AzuredevopsFunctions.getTeam(GetTeamArgs.builder()
            .projectId(exampleProject.id())
            .name("Example Project Team")
            .build());

    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example_project = azuredevops.Project("exampleProject",
    work_item_template="Agile",
    version_control="Git",
    visibility="private",
    description="Managed by Terraform")
example_team = azuredevops.get_team_output(project_id=example_project.id,
    name="Example Project Team")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const exampleProject = new azuredevops.Project("exampleProject", {
    workItemTemplate: "Agile",
    versionControl: "Git",
    visibility: "private",
    description: "Managed by Terraform",
});
const exampleTeam = azuredevops.getTeamOutput({
    projectId: exampleProject.id,
    name: "Example Project Team",
});
resources:
  exampleProject:
    type: azuredevops:Project
    properties:
      workItemTemplate: Agile
      versionControl: Git
      visibility: private
      description: Managed by Terraform
variables:
  exampleTeam:
    fn::invoke:
      Function: azuredevops:getTeam
      Arguments:
        projectId: ${exampleProject.id}
        name: Example Project Team

Using getTeam

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 getTeam(args: GetTeamArgs, opts?: InvokeOptions): Promise<GetTeamResult>
function getTeamOutput(args: GetTeamOutputArgs, opts?: InvokeOptions): Output<GetTeamResult>
def get_team(name: Optional[str] = None,
             project_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetTeamResult
def get_team_output(name: Optional[pulumi.Input[str]] = None,
             project_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetTeamResult]
func LookupTeam(ctx *Context, args *LookupTeamArgs, opts ...InvokeOption) (*LookupTeamResult, error)
func LookupTeamOutput(ctx *Context, args *LookupTeamOutputArgs, opts ...InvokeOption) LookupTeamResultOutput

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

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

The following arguments are supported:

Name string

The name of the Team.

ProjectId string

The Project ID.

Name string

The name of the Team.

ProjectId string

The Project ID.

name String

The name of the Team.

projectId String

The Project ID.

name string

The name of the Team.

projectId string

The Project ID.

name str

The name of the Team.

project_id str

The Project ID.

name String

The name of the Team.

projectId String

The Project ID.

getTeam Result

The following output properties are available:

Administrators List<string>

List of subject descriptors for administrators of the team.

Description string

Team description.

Id string

The provider-assigned unique ID for this managed resource.

Members List<string>

List of subject descriptors for members of the team.

Name string
ProjectId string
Administrators []string

List of subject descriptors for administrators of the team.

Description string

Team description.

Id string

The provider-assigned unique ID for this managed resource.

Members []string

List of subject descriptors for members of the team.

Name string
ProjectId string
administrators List<String>

List of subject descriptors for administrators of the team.

description String

Team description.

id String

The provider-assigned unique ID for this managed resource.

members List<String>

List of subject descriptors for members of the team.

name String
projectId String
administrators string[]

List of subject descriptors for administrators of the team.

description string

Team description.

id string

The provider-assigned unique ID for this managed resource.

members string[]

List of subject descriptors for members of the team.

name string
projectId string
administrators Sequence[str]

List of subject descriptors for administrators of the team.

description str

Team description.

id str

The provider-assigned unique ID for this managed resource.

members Sequence[str]

List of subject descriptors for members of the team.

name str
project_id str
administrators List<String>

List of subject descriptors for administrators of the team.

description String

Team description.

id String

The provider-assigned unique ID for this managed resource.

members List<String>

List of subject descriptors for members of the team.

name String
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.