GetUsers

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

Example Usage

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var user = Output.Create(AzureDevOps.Identities.GetUsers.InvokeAsync(new AzureDevOps.Identities.GetUsersArgs
        {
            PrincipalName = "contoso-user@contoso.onmicrosoft.com",
        }));
        var all_users = Output.Create(AzureDevOps.Identities.GetUsers.InvokeAsync());
        var all_from_origin = Output.Create(AzureDevOps.Identities.GetUsers.InvokeAsync(new AzureDevOps.Identities.GetUsersArgs
        {
            Origin = "aad",
        }));
        var all_from_subjectTypes = Output.Create(AzureDevOps.Identities.GetUsers.InvokeAsync(new AzureDevOps.Identities.GetUsersArgs
        {
            SubjectTypes = 
            {
                "aad",
                "msa",
            },
        }));
        var all_from_origin_id = Output.Create(AzureDevOps.Identities.GetUsers.InvokeAsync(new AzureDevOps.Identities.GetUsersArgs
        {
            Origin = "aad",
            OriginId = "a7ead982-8438-4cd2-b9e3-c3aa51a7b675",
        }));
    }

}

Coming soon!

import pulumi
import pulumi_azuredevops as azuredevops

user = azuredevops.Identities.get_users(principal_name="contoso-user@contoso.onmicrosoft.com")
all_users = azuredevops.Identities.get_users()
all_from_origin = azuredevops.Identities.get_users(origin="aad")
all_from_subject_types = azuredevops.Identities.get_users(subject_types=[
    "aad",
    "msa",
])
all_from_origin_id = azuredevops.Identities.get_users(origin="aad",
    origin_id="a7ead982-8438-4cd2-b9e3-c3aa51a7b675")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

// Load single user by using it's principal name
const user = pulumi.output(azuredevops.Identities.getUsers({
    principalName: "contoso-user@contoso.onmicrosoft.com",
}, { async: true }));
// Load all users know inside an organization
const all_users = pulumi.output(azuredevops.Identities.getUsers({ async: true }));
// Load all users know inside an organization originating from a specific source (origin)
const all_from_origin = pulumi.output(azuredevops.Identities.getUsers({
    origin: "aad",
}, { async: true }));
// Load all users know inside an organization filtered by their subject types
const all_from_subject_types = pulumi.output(azuredevops.Identities.getUsers({
    subjectTypes: [
        "aad",
        "msa",
    ],
}, { async: true }));
// Load a single user by origin and origin ID
const all_from_origin_id = pulumi.output(azuredevops.Identities.getUsers({
    origin: "aad",
    originId: "a7ead982-8438-4cd2-b9e3-c3aa51a7b675",
}, { async: true }));

Using GetUsers

function getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function  get_users(origin=None, origin_id=None, principal_name=None, subject_types=None, opts=None)
func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
public static class GetUsers {
    public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Origin string
OriginId string
PrincipalName string
SubjectTypes List<string>
Origin string
OriginId string
PrincipalName string
SubjectTypes []string
origin string
originId string
principalName string
subjectTypes string[]
origin str
origin_id str
principal_name str
subject_types List[str]

GetUsers Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Users List<Pulumi.AzureDevOps.Identities.Outputs.GetUsersUser>
Origin string
OriginId string
PrincipalName string
SubjectTypes List<string>
Id string

The provider-assigned unique ID for this managed resource.

Users []GetUsersUser
Origin string
OriginId string
PrincipalName string
SubjectTypes []string
id string

The provider-assigned unique ID for this managed resource.

users GetUsersUser[]
origin string
originId string
principalName string
subjectTypes string[]
id str

The provider-assigned unique ID for this managed resource.

users List[GetUsersUser]
origin str
origin_id str
principal_name str
subject_types List[str]

Supporting Types

GetUsersUser

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Descriptor string
DisplayName string
MailAddress string
Origin string
PrincipalName string
OriginId string
Descriptor string
DisplayName string
MailAddress string
Origin string
PrincipalName string
OriginId string
descriptor string
displayName string
mailAddress string
origin string
principalName string
originId string
descriptor str
display_name str
mailAddress str
origin str
principal_name str
origin_id str

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.