azuredevops logo
Azure DevOps v2.7.0, Mar 27 23

azuredevops.getUsers

Explore with Pulumi AI

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

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var example = AzureDevOps.GetUsers.Invoke(new()
    {
        PrincipalName = "contoso-user@contoso.onmicrosoft.com",
    });

    var example_all_users = AzureDevOps.GetUsers.Invoke();

    var example_all_from_origin = AzureDevOps.GetUsers.Invoke(new()
    {
        Origin = "aad",
    });

    var example_all_from_subjectTypes = AzureDevOps.GetUsers.Invoke(new()
    {
        SubjectTypes = new[]
        {
            "aad",
            "msa",
        },
    });

    var example_all_from_origin_id = AzureDevOps.GetUsers.Invoke(new()
    {
        Origin = "aad",
        OriginId = "00000000-0000-0000-0000-000000000000",
    });

});
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 {
		_, err := azuredevops.GetUsers(ctx, &azuredevops.GetUsersArgs{
			PrincipalName: pulumi.StringRef("contoso-user@contoso.onmicrosoft.com"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = azuredevops.GetUsers(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = azuredevops.GetUsers(ctx, &azuredevops.GetUsersArgs{
			Origin: pulumi.StringRef("aad"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = azuredevops.GetUsers(ctx, &azuredevops.GetUsersArgs{
			SubjectTypes: []string{
				"aad",
				"msa",
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = azuredevops.GetUsers(ctx, &azuredevops.GetUsersArgs{
			Origin:   pulumi.StringRef("aad"),
			OriginId: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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.GetUsersArgs;
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.getUsers(GetUsersArgs.builder()
            .principalName("contoso-user@contoso.onmicrosoft.com")
            .build());

        final var example-all-users = AzuredevopsFunctions.getUsers();

        final var example-all-from-origin = AzuredevopsFunctions.getUsers(GetUsersArgs.builder()
            .origin("aad")
            .build());

        final var example-all-from-subjectTypes = AzuredevopsFunctions.getUsers(GetUsersArgs.builder()
            .subjectTypes(            
                "aad",
                "msa")
            .build());

        final var example-all-from-origin-id = AzuredevopsFunctions.getUsers(GetUsersArgs.builder()
            .origin("aad")
            .originId("00000000-0000-0000-0000-000000000000")
            .build());

    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example = azuredevops.get_users(principal_name="contoso-user@contoso.onmicrosoft.com")
example_all_users = azuredevops.get_users()
example_all_from_origin = azuredevops.get_users(origin="aad")
example_all_from_subject_types = azuredevops.get_users(subject_types=[
    "aad",
    "msa",
])
example_all_from_origin_id = azuredevops.get_users(origin="aad",
    origin_id="00000000-0000-0000-0000-000000000000")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const example = azuredevops.getUsers({
    principalName: "contoso-user@contoso.onmicrosoft.com",
});
const example-all-users = azuredevops.getUsers({});
const example-all-from-origin = azuredevops.getUsers({
    origin: "aad",
});
const example-all-from-subjectTypes = azuredevops.getUsers({
    subjectTypes: [
        "aad",
        "msa",
    ],
});
const example-all-from-origin-id = azuredevops.getUsers({
    origin: "aad",
    originId: "00000000-0000-0000-0000-000000000000",
});
variables:
  example:
    fn::invoke:
      Function: azuredevops:getUsers
      Arguments:
        principalName: contoso-user@contoso.onmicrosoft.com
  example-all-users:
    fn::invoke:
      Function: azuredevops:getUsers
      Arguments: {}
  example-all-from-origin:
    fn::invoke:
      Function: azuredevops:getUsers
      Arguments:
        origin: aad
  example-all-from-subjectTypes:
    fn::invoke:
      Function: azuredevops:getUsers
      Arguments:
        subjectTypes:
          - aad
          - msa
  example-all-from-origin-id:
    fn::invoke:
      Function: azuredevops:getUsers
      Arguments:
        origin: aad
        originId: 00000000-0000-0000-0000-000000000000

Using getUsers

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 getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOptions): Output<GetUsersResult>
def get_users(origin: Optional[str] = None,
              origin_id: Optional[str] = None,
              principal_name: Optional[str] = None,
              subject_types: Optional[Sequence[str]] = None,
              opts: Optional[InvokeOptions] = None) -> GetUsersResult
def get_users_output(origin: Optional[pulumi.Input[str]] = None,
              origin_id: Optional[pulumi.Input[str]] = None,
              principal_name: Optional[pulumi.Input[str]] = None,
              subject_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetUsersResult]
func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
func GetUsersOutput(ctx *Context, args *GetUsersOutputArgs, opts ...InvokeOption) GetUsersResultOutput

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

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

The following arguments are supported:

Origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

OriginId string

The unique identifier from the system of origin.

PrincipalName string

The PrincipalName of this graph member from the source provider.

SubjectTypes List<string>

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

Origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

OriginId string

The unique identifier from the system of origin.

PrincipalName string

The PrincipalName of this graph member from the source provider.

SubjectTypes []string

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

origin String

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

originId String

The unique identifier from the system of origin.

principalName String

The PrincipalName of this graph member from the source provider.

subjectTypes List<String>

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

originId string

The unique identifier from the system of origin.

principalName string

The PrincipalName of this graph member from the source provider.

subjectTypes string[]

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

origin str

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

origin_id str

The unique identifier from the system of origin.

principal_name str

The PrincipalName of this graph member from the source provider.

subject_types Sequence[str]

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

origin String

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

originId String

The unique identifier from the system of origin.

principalName String

The PrincipalName of this graph member from the source provider.

subjectTypes List<String>

A list of user subject subtypes to reduce the retrieved results, e.g. msa, aad, svc (service identity), imp (imported identity), etc. The supported subject types are listed below.

getUsers Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Users List<Pulumi.AzureDevOps.Outputs.GetUsersUser>

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

Origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

OriginId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

PrincipalName string

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

SubjectTypes List<string>
Id string

The provider-assigned unique ID for this managed resource.

Users []GetUsersUser

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

Origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

OriginId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

PrincipalName string

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

SubjectTypes []string
id String

The provider-assigned unique ID for this managed resource.

users List<GetUsersUser>

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

origin String

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId String

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

principalName String

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

subjectTypes List<String>
id string

The provider-assigned unique ID for this managed resource.

users GetUsersUser[]

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

principalName string

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

subjectTypes string[]
id str

The provider-assigned unique ID for this managed resource.

users Sequence[GetUsersUser]

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

origin str

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

origin_id str

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

principal_name str

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

subject_types Sequence[str]
id String

The provider-assigned unique ID for this managed resource.

users List<Property Map>

A set of existing users in your Azure DevOps Organization with details about every single user which includes:

origin String

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId String

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

principalName String

This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.

subjectTypes List<String>

Supporting Types

GetUsersUser

Descriptor string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

DisplayName string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

Id string

The user ID.

MailAddress string

The email address of record for a given graph member. This may be different than the principal name.

Origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

PrincipalName string

The PrincipalName of this graph member from the source provider.

OriginId string

The unique identifier from the system of origin.

Descriptor string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

DisplayName string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

Id string

The user ID.

MailAddress string

The email address of record for a given graph member. This may be different than the principal name.

Origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

PrincipalName string

The PrincipalName of this graph member from the source provider.

OriginId string

The unique identifier from the system of origin.

descriptor String

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

displayName String

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id String

The user ID.

mailAddress String

The email address of record for a given graph member. This may be different than the principal name.

origin String

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

principalName String

The PrincipalName of this graph member from the source provider.

originId String

The unique identifier from the system of origin.

descriptor string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

displayName string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id string

The user ID.

mailAddress string

The email address of record for a given graph member. This may be different than the principal name.

origin string

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

principalName string

The PrincipalName of this graph member from the source provider.

originId string

The unique identifier from the system of origin.

descriptor str

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

display_name str

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id str

The user ID.

mail_address str

The email address of record for a given graph member. This may be different than the principal name.

origin str

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

principal_name str

The PrincipalName of this graph member from the source provider.

origin_id str

The unique identifier from the system of origin.

descriptor String

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

displayName String

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id String

The user ID.

mailAddress String

The email address of record for a given graph member. This may be different than the principal name.

origin String

The type of source provider for the origin_id parameter (ex:AD, AAD, MSA) The supported origins are listed below.

principalName String

The PrincipalName of this graph member from the source provider.

originId String

The unique identifier from the system of origin.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes

This Pulumi package is based on the azuredevops Terraform Provider.