1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. User
Azure DevOps v3.9.0 published on Tuesday, Apr 22, 2025 by Pulumi

azuredevops.User

Explore with Pulumi AI

Manages a user entitlement within Azure DevOps.

Example Usage

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

const example = new azuredevops.User("example", {principalName: "foo@contoso.com"});
Copy
import pulumi
import pulumi_azuredevops as azuredevops

example = azuredevops.User("example", principal_name="foo@contoso.com")
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 {
		_, err := azuredevops.NewUser(ctx, "example", &azuredevops.UserArgs{
			PrincipalName: pulumi.String("foo@contoso.com"),
		})
		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.User("example", new()
    {
        PrincipalName = "foo@contoso.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.User;
import com.pulumi.azuredevops.UserArgs;
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 User("example", UserArgs.builder()
            .principalName("foo@contoso.com")
            .build());

    }
}
Copy
resources:
  example:
    type: azuredevops:User
    properties:
      principalName: foo@contoso.com
Copy

PAT Permissions Required

  • Member Entitlement Management: Read & Write

Create User Resource

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

Constructor syntax

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

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         account_license_type: Optional[str] = None,
         licensing_source: Optional[str] = None,
         origin: Optional[str] = None,
         origin_id: Optional[str] = None,
         principal_name: Optional[str] = None)
func NewUser(ctx *Context, name string, args *UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs? args = null, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: azuredevops:User
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 UserArgs
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 UserArgs
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 UserArgs
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 UserArgs
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. UserArgs
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 userResource = new AzureDevOps.User("userResource", new()
{
    AccountLicenseType = "string",
    LicensingSource = "string",
    Origin = "string",
    OriginId = "string",
    PrincipalName = "string",
});
Copy
example, err := azuredevops.NewUser(ctx, "userResource", &azuredevops.UserArgs{
	AccountLicenseType: pulumi.String("string"),
	LicensingSource:    pulumi.String("string"),
	Origin:             pulumi.String("string"),
	OriginId:           pulumi.String("string"),
	PrincipalName:      pulumi.String("string"),
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .accountLicenseType("string")
    .licensingSource("string")
    .origin("string")
    .originId("string")
    .principalName("string")
    .build());
Copy
user_resource = azuredevops.User("userResource",
    account_license_type="string",
    licensing_source="string",
    origin="string",
    origin_id="string",
    principal_name="string")
Copy
const userResource = new azuredevops.User("userResource", {
    accountLicenseType: "string",
    licensingSource: "string",
    origin: "string",
    originId: "string",
    principalName: "string",
});
Copy
type: azuredevops:User
properties:
    accountLicenseType: string
    licensingSource: string
    origin: string
    originId: string
    principalName: string
Copy

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

AccountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
LicensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

Origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
OriginId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
PrincipalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
AccountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
LicensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

Origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
OriginId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
PrincipalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType String
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
licensingSource String

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. String
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. String
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. String
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
licensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
account_license_type str
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
licensing_source str

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. str
The type of source provider for the origin identifier.
origin_id Changes to this property will trigger replacement. str
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principal_name Changes to this property will trigger replacement. str
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType String
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
licensingSource String

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. String
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. String
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. String
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.

Outputs

All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

Descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
Id string
The provider-assigned unique ID for this managed resource.
Descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
Id string
The provider-assigned unique ID for this managed resource.
descriptor String
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
id String
The provider-assigned unique ID for this managed resource.
descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
id string
The provider-assigned unique ID for this managed resource.
descriptor str
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
id str
The provider-assigned unique ID for this managed resource.
descriptor String
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing User Resource

Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_license_type: Optional[str] = None,
        descriptor: Optional[str] = None,
        licensing_source: Optional[str] = None,
        origin: Optional[str] = None,
        origin_id: Optional[str] = None,
        principal_name: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
resources:  _:    type: azuredevops:User    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:
AccountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
Descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
LicensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

Origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
OriginId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
PrincipalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
AccountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
Descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
LicensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

Origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
OriginId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
PrincipalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType String
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
descriptor String
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
licensingSource String

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. String
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. String
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. String
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType string
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
descriptor string
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
licensingSource string

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. string
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. string
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. string
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
account_license_type str
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
descriptor str
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
licensing_source str

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. str
The type of source provider for the origin identifier.
origin_id Changes to this property will trigger replacement. str
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principal_name Changes to this property will trigger replacement. str
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.
accountLicenseType String
Type of Account License. Valid values: advanced, earlyAdopter, express, none, professional, or stakeholder. Defaults to express. In addition the value basic is allowed which is an alias for express and reflects the name of the express license used in the Azure DevOps web interface.
descriptor String
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the user graph subject.
licensingSource String

The source of the licensing (e.g. Account. MSDN etc.) Valid values: account (Default), auto, msdn, none, profile, trial

NOTE: A user can only be referenced by it's principal_name or by the combination of origin_id and origin.

origin Changes to this property will trigger replacement. String
The type of source provider for the origin identifier.
originId Changes to this property will trigger replacement. String
The unique identifier from the system of origin. Typically a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
principalName Changes to this property will trigger replacement. String
The principal name is the PrincipalName of a graph member from the source provider. Usually, e-mail address.

Import

This resource allows importing by the UUID of a user entitlement or by using the principal name of a user who owns the entitlement.

$ pulumi import azuredevops:index/user:User example "00000000-0000-0000-0000-000000000000"
Copy

or

$ pulumi import azuredevops:index/user:User example "example@example.com"
Copy

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.