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

azuredevops.TeamAdministrators

Explore with Pulumi AI

*—

layout: “azuredevops” page_title: “AzureDevops: azuredevops.TeamAdministrators” description: |- Manages administrators of a team within a project in a Azure DevOps organization.

azuredevops.TeamAdministrators

Manages administrators of a team within a project in a Azure DevOps organization.

Example 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 example_project_contributors = azuredevops.getGroupOutput({
    projectId: example.id,
    name: "Contributors",
});
const exampleTeam = new azuredevops.Team("example", {
    projectId: example.id,
    name: pulumi.interpolate`${example.name} Team 2`,
});
const example_team_administrators = new azuredevops.TeamAdministrators("example-team-administrators", {
    projectId: exampleTeam.projectId,
    teamId: exampleTeam.id,
    mode: "overwrite",
    administrators: [example_project_contributors.apply(example_project_contributors => example_project_contributors.descriptor)],
});
Copy
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_project_contributors = azuredevops.get_group_output(project_id=example.id,
    name="Contributors")
example_team = azuredevops.Team("example",
    project_id=example.id,
    name=example.name.apply(lambda name: f"{name} Team 2"))
example_team_administrators = azuredevops.TeamAdministrators("example-team-administrators",
    project_id=example_team.project_id,
    team_id=example_team.id,
    mode="overwrite",
    administrators=[example_project_contributors.descriptor])
Copy
package main

import (
	"fmt"

	"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
		}
		example_project_contributors := azuredevops.LookupGroupOutput(ctx, azuredevops.GetGroupOutputArgs{
			ProjectId: example.ID(),
			Name:      pulumi.String("Contributors"),
		}, nil)
		exampleTeam, err := azuredevops.NewTeam(ctx, "example", &azuredevops.TeamArgs{
			ProjectId: example.ID(),
			Name: example.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("%v Team 2", name), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewTeamAdministrators(ctx, "example-team-administrators", &azuredevops.TeamAdministratorsArgs{
			ProjectId: exampleTeam.ProjectId,
			TeamId:    exampleTeam.ID(),
			Mode:      pulumi.String("overwrite"),
			Administrators: pulumi.StringArray{
				pulumi.String(example_project_contributors.ApplyT(func(example_project_contributors azuredevops.GetGroupResult) (*string, error) {
					return &example_project_contributors.Descriptor, nil
				}).(pulumi.StringPtrOutput)),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 example_project_contributors = AzureDevOps.GetGroup.Invoke(new()
    {
        ProjectId = example.Id,
        Name = "Contributors",
    });

    var exampleTeam = new AzureDevOps.Team("example", new()
    {
        ProjectId = example.Id,
        Name = example.Name.Apply(name => $"{name} Team 2"),
    });

    var example_team_administrators = new AzureDevOps.TeamAdministrators("example-team-administrators", new()
    {
        ProjectId = exampleTeam.ProjectId,
        TeamId = exampleTeam.Id,
        Mode = "overwrite",
        Administrators = new[]
        {
            example_project_contributors.Apply(example_project_contributors => example_project_contributors.Apply(getGroupResult => getGroupResult.Descriptor)),
        },
    });

});
Copy
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.GetGroupArgs;
import com.pulumi.azuredevops.Team;
import com.pulumi.azuredevops.TeamArgs;
import com.pulumi.azuredevops.TeamAdministrators;
import com.pulumi.azuredevops.TeamAdministratorsArgs;
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());

        final var example-project-contributors = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
            .projectId(example.id())
            .name("Contributors")
            .build());

        var exampleTeam = new Team("exampleTeam", TeamArgs.builder()
            .projectId(example.id())
            .name(example.name().applyValue(name -> String.format("%s Team 2", name)))
            .build());

        var example_team_administrators = new TeamAdministrators("example-team-administrators", TeamAdministratorsArgs.builder()
            .projectId(exampleTeam.projectId())
            .teamId(exampleTeam.id())
            .mode("overwrite")
            .administrators(example_project_contributors.applyValue(example_project_contributors -> example_project_contributors.descriptor()))
            .build());

    }
}
Copy
resources:
  example:
    type: azuredevops:Project
    properties:
      name: Example Project
      workItemTemplate: Agile
      versionControl: Git
      visibility: private
      description: Managed by Pulumi
  exampleTeam:
    type: azuredevops:Team
    name: example
    properties:
      projectId: ${example.id}
      name: ${example.name} Team 2
  example-team-administrators:
    type: azuredevops:TeamAdministrators
    properties:
      projectId: ${exampleTeam.projectId}
      teamId: ${exampleTeam.id}
      mode: overwrite
      administrators:
        - ${["example-project-contributors"].descriptor}
variables:
  example-project-contributors:
    fn::invoke:
      function: azuredevops:getGroup
      arguments:
        projectId: ${example.id}
        name: Contributors
Copy

PAT Permissions Required

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

Create TeamAdministrators Resource

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

Constructor syntax

new TeamAdministrators(name: string, args: TeamAdministratorsArgs, opts?: CustomResourceOptions);
@overload
def TeamAdministrators(resource_name: str,
                       args: TeamAdministratorsArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def TeamAdministrators(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       administrators: Optional[Sequence[str]] = None,
                       project_id: Optional[str] = None,
                       team_id: Optional[str] = None,
                       mode: Optional[str] = None)
func NewTeamAdministrators(ctx *Context, name string, args TeamAdministratorsArgs, opts ...ResourceOption) (*TeamAdministrators, error)
public TeamAdministrators(string name, TeamAdministratorsArgs args, CustomResourceOptions? opts = null)
public TeamAdministrators(String name, TeamAdministratorsArgs args)
public TeamAdministrators(String name, TeamAdministratorsArgs args, CustomResourceOptions options)
type: azuredevops:TeamAdministrators
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TeamAdministratorsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TeamAdministratorsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TeamAdministratorsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TeamAdministratorsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TeamAdministratorsArgs
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 teamAdministratorsResource = new AzureDevOps.TeamAdministrators("teamAdministratorsResource", new()
{
    Administrators = new[]
    {
        "string",
    },
    ProjectId = "string",
    TeamId = "string",
    Mode = "string",
});
Copy
example, err := azuredevops.NewTeamAdministrators(ctx, "teamAdministratorsResource", &azuredevops.TeamAdministratorsArgs{
	Administrators: pulumi.StringArray{
		pulumi.String("string"),
	},
	ProjectId: pulumi.String("string"),
	TeamId:    pulumi.String("string"),
	Mode:      pulumi.String("string"),
})
Copy
var teamAdministratorsResource = new TeamAdministrators("teamAdministratorsResource", TeamAdministratorsArgs.builder()
    .administrators("string")
    .projectId("string")
    .teamId("string")
    .mode("string")
    .build());
Copy
team_administrators_resource = azuredevops.TeamAdministrators("teamAdministratorsResource",
    administrators=["string"],
    project_id="string",
    team_id="string",
    mode="string")
Copy
const teamAdministratorsResource = new azuredevops.TeamAdministrators("teamAdministratorsResource", {
    administrators: ["string"],
    projectId: "string",
    teamId: "string",
    mode: "string",
});
Copy
type: azuredevops:TeamAdministrators
properties:
    administrators:
        - string
    mode: string
    projectId: string
    teamId: string
Copy

TeamAdministrators 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 TeamAdministrators resource accepts the following input properties:

Administrators This property is required. List<string>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The Project ID.
TeamId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Team.
Mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

Administrators This property is required. []string

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The Project ID.
TeamId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Team.
Mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

administrators This property is required. List<String>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

projectId
This property is required.
Changes to this property will trigger replacement.
String
The Project ID.
teamId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Team.
mode String

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

administrators This property is required. string[]

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

projectId
This property is required.
Changes to this property will trigger replacement.
string
The Project ID.
teamId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Team.
mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

administrators This property is required. Sequence[str]

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

project_id
This property is required.
Changes to this property will trigger replacement.
str
The Project ID.
team_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Team.
mode str

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

administrators This property is required. List<String>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

projectId
This property is required.
Changes to this property will trigger replacement.
String
The Project ID.
teamId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Team.
mode String

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

Outputs

All input properties are implicitly available as output properties. Additionally, the TeamAdministrators 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 TeamAdministrators Resource

Get an existing TeamAdministrators 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?: TeamAdministratorsState, opts?: CustomResourceOptions): TeamAdministrators
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        administrators: Optional[Sequence[str]] = None,
        mode: Optional[str] = None,
        project_id: Optional[str] = None,
        team_id: Optional[str] = None) -> TeamAdministrators
func GetTeamAdministrators(ctx *Context, name string, id IDInput, state *TeamAdministratorsState, opts ...ResourceOption) (*TeamAdministrators, error)
public static TeamAdministrators Get(string name, Input<string> id, TeamAdministratorsState? state, CustomResourceOptions? opts = null)
public static TeamAdministrators get(String name, Output<String> id, TeamAdministratorsState state, CustomResourceOptions options)
resources:  _:    type: azuredevops:TeamAdministrators    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Administrators List<string>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

Mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

ProjectId Changes to this property will trigger replacement. string
The Project ID.
TeamId Changes to this property will trigger replacement. string
The ID of the Team.
Administrators []string

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

Mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

ProjectId Changes to this property will trigger replacement. string
The Project ID.
TeamId Changes to this property will trigger replacement. string
The ID of the Team.
administrators List<String>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

mode String

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

projectId Changes to this property will trigger replacement. String
The Project ID.
teamId Changes to this property will trigger replacement. String
The ID of the Team.
administrators string[]

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

mode string

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

projectId Changes to this property will trigger replacement. string
The Project ID.
teamId Changes to this property will trigger replacement. string
The ID of the Team.
administrators Sequence[str]

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

mode str

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

project_id Changes to this property will trigger replacement. str
The Project ID.
team_id Changes to this property will trigger replacement. str
The ID of the Team.
administrators List<String>

List of subject descriptors to define administrators of the team.

NOTE It's possible to define team administrators both within the azuredevops.Team resource via the administrators block and by using the azuredevops.TeamAdministrators resource. However it's not possible to use both methods to manage team administrators, since there'll be conflicts.

mode String

The mode how the resource manages team administrators. Possible values: add, overwrite. Defaults to add.

NOTE: 1. mode = add: the resource will ensure that all specified administrators will be part of the referenced team 2. mode = overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

projectId Changes to this property will trigger replacement. String
The Project ID.
teamId Changes to this property will trigger replacement. String
The ID of the Team.

Import

The resource does not support import.

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.