1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. getTeams
Azure DevOps v3.8.0 published on Monday, Mar 17, 2025 by Pulumi

azuredevops.getTeams

Explore with Pulumi AI

Use this data source to access information about existing Teams in a Project or globally within an Azure DevOps organization

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const example = azuredevops.getTeams({});
export const projectId = example.then(example => example.teams.map(__item => __item.projectId));
export const name = example.then(example => example.teams.map(__item => __item.name));
export const allAdministrators = example.then(example => example.teams.map(__item => __item.administrators));
export const administrators = example.then(example => example.teams.map(__item => __item.members));
Copy
import pulumi
import pulumi_azuredevops as azuredevops

example = azuredevops.get_teams()
pulumi.export("projectId", [__item.project_id for __item in example.teams])
pulumi.export("name", [__item.name for __item in example.teams])
pulumi.export("allAdministrators", [__item.administrators for __item in example.teams])
pulumi.export("administrators", [__item.members for __item in example.teams])
Copy
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.GetTeams(ctx, &azuredevops.GetTeamsArgs{
}, nil);
if err != nil {
return err
}
ctx.Export("projectId", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,11-37)))
ctx.Export("name", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:7,11-32)))
ctx.Export("allAdministrators", []interface{}(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:11,11-42)))
ctx.Export("administrators", []interface{}(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:15,11-35)))
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var example = AzureDevOps.GetTeams.Invoke();

    return new Dictionary<string, object?>
    {
        ["projectId"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.ProjectId).ToList(),
        ["name"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Name).ToList(),
        ["allAdministrators"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Administrators).ToList(),
        ["administrators"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Members).ToList(),
    };
});
Copy
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.GetTeamsArgs;
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.getTeams();

        ctx.export("projectId", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.projectId()).collect(toList()));
        ctx.export("name", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.name()).collect(toList()));
        ctx.export("allAdministrators", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.administrators()).collect(toList()));
        ctx.export("administrators", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.members()).collect(toList()));
    }
}
Copy
Coming soon!

PAT Permissions Required

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

Using getTeams

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 getTeams(args: GetTeamsArgs, opts?: InvokeOptions): Promise<GetTeamsResult>
function getTeamsOutput(args: GetTeamsOutputArgs, opts?: InvokeOptions): Output<GetTeamsResult>
Copy
def get_teams(project_id: Optional[str] = None,
              top: Optional[int] = None,
              opts: Optional[InvokeOptions] = None) -> GetTeamsResult
def get_teams_output(project_id: Optional[pulumi.Input[str]] = None,
              top: Optional[pulumi.Input[int]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTeamsResult]
Copy
func GetTeams(ctx *Context, args *GetTeamsArgs, opts ...InvokeOption) (*GetTeamsResult, error)
func GetTeamsOutput(ctx *Context, args *GetTeamsOutputArgs, opts ...InvokeOption) GetTeamsResultOutput
Copy

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

public static class GetTeams 
{
    public static Task<GetTeamsResult> InvokeAsync(GetTeamsArgs args, InvokeOptions? opts = null)
    public static Output<GetTeamsResult> Invoke(GetTeamsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
public static Output<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azuredevops:index/getTeams:getTeams
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId string
The Project ID. If no project ID all teams of the organization will be returned.
Top int
The maximum number of teams to return. Defaults to 100.
ProjectId string
The Project ID. If no project ID all teams of the organization will be returned.
Top int
The maximum number of teams to return. Defaults to 100.
projectId String
The Project ID. If no project ID all teams of the organization will be returned.
top Integer
The maximum number of teams to return. Defaults to 100.
projectId string
The Project ID. If no project ID all teams of the organization will be returned.
top number
The maximum number of teams to return. Defaults to 100.
project_id str
The Project ID. If no project ID all teams of the organization will be returned.
top int
The maximum number of teams to return. Defaults to 100.
projectId String
The Project ID. If no project ID all teams of the organization will be returned.
top Number
The maximum number of teams to return. Defaults to 100.

getTeams Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Teams List<Pulumi.AzureDevOps.Outputs.GetTeamsTeam>
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
ProjectId string
The ID of the Project.
Top int
Id string
The provider-assigned unique ID for this managed resource.
Teams []GetTeamsTeam
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
ProjectId string
The ID of the Project.
Top int
id String
The provider-assigned unique ID for this managed resource.
teams List<GetTeamsTeam>
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
projectId String
The ID of the Project.
top Integer
id string
The provider-assigned unique ID for this managed resource.
teams GetTeamsTeam[]
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
projectId string
The ID of the Project.
top number
id str
The provider-assigned unique ID for this managed resource.
teams Sequence[GetTeamsTeam]
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
project_id str
The ID of the Project.
top int
id String
The provider-assigned unique ID for this managed resource.
teams List<Property Map>
A list of teams blocks as documented below. A list of existing projects in your Azure DevOps Organization with details about every project which includes:
projectId String
The ID of the Project.
top Number

Supporting Types

GetTeamsTeam

Administrators This property is required. List<string>
List of subject descriptors for administrators of the team.
Description This property is required. string
Team description.
Id This property is required. string
The ID of the Team.
Members This property is required. List<string>
List of subject descriptors for members of the team.
Name This property is required. string
The name of the team.
ProjectId This property is required. string
The Project ID. If no project ID all teams of the organization will be returned.
Administrators This property is required. []string
List of subject descriptors for administrators of the team.
Description This property is required. string
Team description.
Id This property is required. string
The ID of the Team.
Members This property is required. []string
List of subject descriptors for members of the team.
Name This property is required. string
The name of the team.
ProjectId This property is required. string
The Project ID. If no project ID all teams of the organization will be returned.
administrators This property is required. List<String>
List of subject descriptors for administrators of the team.
description This property is required. String
Team description.
id This property is required. String
The ID of the Team.
members This property is required. List<String>
List of subject descriptors for members of the team.
name This property is required. String
The name of the team.
projectId This property is required. String
The Project ID. If no project ID all teams of the organization will be returned.
administrators This property is required. string[]
List of subject descriptors for administrators of the team.
description This property is required. string
Team description.
id This property is required. string
The ID of the Team.
members This property is required. string[]
List of subject descriptors for members of the team.
name This property is required. string
The name of the team.
projectId This property is required. string
The Project ID. If no project ID all teams of the organization will be returned.
administrators This property is required. Sequence[str]
List of subject descriptors for administrators of the team.
description This property is required. str
Team description.
id This property is required. str
The ID of the Team.
members This property is required. Sequence[str]
List of subject descriptors for members of the team.
name This property is required. str
The name of the team.
project_id This property is required. str
The Project ID. If no project ID all teams of the organization will be returned.
administrators This property is required. List<String>
List of subject descriptors for administrators of the team.
description This property is required. String
Team description.
id This property is required. String
The ID of the Team.
members This property is required. List<String>
List of subject descriptors for members of the team.
name This property is required. String
The name of the team.
projectId This property is required. String
The Project ID. If no project ID all teams of the organization will be returned.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.