Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/azdo_help_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,23 @@ ls, l

Manage members of a team.

#### `azdo team member add [ORGANIZATION/]PROJECT/TEAM [flags]`

Add one or more members to a team.

```
-q, --jq expression Filter JSON output using a jq expression
--json fields[=*] Output JSON with the specified fields. Prefix a field with '-' to exclude it.
-t, --template string Format JSON output using a Go template; see "azdo help formatting"
-u, --user strings Members to add. Accepts a descriptor, email, principal name, SID, or identity ID. Pass the flag multiple times to add several members.
```

Aliases

```
a
```

#### `azdo team member list [ORGANIZATION/]PROJECT/TEAM [flags]`

List members of a team.
Expand Down
1 change: 1 addition & 0 deletions docs/azdo_team_member.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Manage members of a team.

### Available commands

* [azdo team member add](./azdo_team_member_add.md)
* [azdo team member list](./azdo_team_member_list.md)

### See also
Expand Down
56 changes: 56 additions & 0 deletions docs/azdo_team_member_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Command `azdo team member add`

```
azdo team member add [ORGANIZATION/]PROJECT/TEAM [flags]
```

Add one or more users or groups as members of a team.

The positional argument accepts the team's project and team name in the
form [ORGANIZATION/]PROJECT/TEAM.


### Options


* `-q`, `--jq` `expression`

Filter JSON output using a jq expression

* `--json` `fields`

Output JSON with the specified fields. Prefix a field with '-' to exclude it.

* `-t`, `--template` `string`

Format JSON output using a Go template; see "azdo help formatting"

* `-u`, `--user` `strings`

Members to add. Accepts a descriptor, email, principal name, SID, or identity ID. Pass the flag multiple times to add several members.


### ALIASES

- `a`

### JSON Fields

`memberDescriptor`, `memberDisplayName`, `memberOrigin`, `memberOriginId`, `results`, `status`, `teamName`

### Examples

```bash
# Add a user by email
azdo team member add Fabrikam/FabrikamEngineering/MyTeam --user user@example.com

# Add multiple users in a single invocation
azdo team member add Fabrikam/MyProject/MyTeam -u alice@contoso.com -u bob@contoso.com

# Add a user by subject descriptor
azdo team member add MyOrg/Fabrikam/MyTeam --user vssgp.Uy0xLTItMw==
```

### See also

* [azdo team member](./azdo_team_member.md)
4 changes: 4 additions & 0 deletions internal/azdo/extensions/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type Client interface {
FindGroupsByDisplayName(ctx context.Context, displayName string, scopeDescriptor *string) ([]*graph.GraphGroup, error)
// ResolveSubject resolves a member identifier (descriptor, email, or principal name) into a graph subject descriptor.
ResolveSubject(ctx context.Context, member string) (*graph.GraphSubject, error)
// ResolveSubjects resolves a batch of member identifiers in a single call, reducing round trips.
// Inputs that cannot be resolved are absent from the result map (keyed by the trimmed input string).
// The map naturally deduplicates repeated inputs; only catastrophic failures (e.g. client creation) return an error.
ResolveSubjects(ctx context.Context, members []string) (map[string]*graph.GraphSubject, error)
ResolveIdentity(ctx context.Context, member string) (*identity.Identity, error)
}

Expand Down
Loading
Loading