User

Manages a User within Azure Active Directory.

NOTE: If you’re authenticating using a Service Principal then it must have permissions to Directory.ReadWrite.All within the Windows Azure Active Directory API.

Example Usage

using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AzureAD.User("example", new AzureAD.UserArgs
        {
            DisplayName = "J. Doe",
            MailNickname = "jdoe",
            Password = "SecretP@sswd99!",
            UserPrincipalName = "jdo@hashicorp.com",
        });
    }

}

Coming soon!

import pulumi
import pulumi_azuread as azuread

example = azuread.User("example",
    display_name="J. Doe",
    mail_nickname="jdoe",
    password="SecretP@sswd99!",
    user_principal_name="jdo@hashicorp.com")
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = new azuread.User("example", {
    displayName: "J. Doe",
    mailNickname: "jdoe",
    password: "SecretP@sswd99!",
    userPrincipalName: "jdo@hashicorp.com",
});

Create a User Resource

new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
def User(resource_name, opts=None, account_enabled=None, display_name=None, force_password_change=None, immutable_id=None, mail_nickname=None, password=None, usage_location=None, user_principal_name=None, __props__=None);
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
name 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 str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name 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 string
The unique name of the resource.
args UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

User Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The User resource accepts the following input properties:

DisplayName string

The name to display in the address book for the user.

Password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

UserPrincipalName string

The User Principal Name of the Azure AD User.

AccountEnabled bool

true if the account should be enabled, otherwise false. Defaults to true.

ForcePasswordChange bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

ImmutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

MailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

UsageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

DisplayName string

The name to display in the address book for the user.

Password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

UserPrincipalName string

The User Principal Name of the Azure AD User.

AccountEnabled bool

true if the account should be enabled, otherwise false. Defaults to true.

ForcePasswordChange bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

ImmutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

MailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

UsageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

displayName string

The name to display in the address book for the user.

password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

userPrincipalName string

The User Principal Name of the Azure AD User.

accountEnabled boolean

true if the account should be enabled, otherwise false. Defaults to true.

forcePasswordChange boolean

true if the User is forced to change the password during the next sign-in. Defaults to false.

immutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

mailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

usageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

display_name str

The name to display in the address book for the user.

password str

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

user_principal_name str

The User Principal Name of the Azure AD User.

account_enabled bool

true if the account should be enabled, otherwise false. Defaults to true.

force_password_change bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

immutable_id str

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

mail_nickname str

The mail alias for the user. Defaults to the user name part of the User Principal Name.

usage_location str

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Mail string

The primary email address of the Azure AD User.

ObjectId string

The Object ID of the Azure AD User.

OnpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

OnpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

Id string
The provider-assigned unique ID for this managed resource.
Mail string

The primary email address of the Azure AD User.

ObjectId string

The Object ID of the Azure AD User.

OnpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

OnpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

id string
The provider-assigned unique ID for this managed resource.
mail string

The primary email address of the Azure AD User.

objectId string

The Object ID of the Azure AD User.

onpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

onpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

id str
The provider-assigned unique ID for this managed resource.
mail str

The primary email address of the Azure AD User.

object_id str

The Object ID of the Azure AD User.

onpremises_sam_account_name str

The on premise sam account name of the Azure AD User.

onpremises_user_principal_name str

The on premise user principal name of the Azure AD User.

Look up an 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
static get(resource_name, id, opts=None, account_enabled=None, display_name=None, force_password_change=None, immutable_id=None, mail=None, mail_nickname=None, object_id=None, onpremises_sam_account_name=None, onpremises_user_principal_name=None, password=None, usage_location=None, user_principal_name=None, __props__=None);
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)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

AccountEnabled bool

true if the account should be enabled, otherwise false. Defaults to true.

DisplayName string

The name to display in the address book for the user.

ForcePasswordChange bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

ImmutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

Mail string

The primary email address of the Azure AD User.

MailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

ObjectId string

The Object ID of the Azure AD User.

OnpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

OnpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

Password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

UsageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

UserPrincipalName string

The User Principal Name of the Azure AD User.

AccountEnabled bool

true if the account should be enabled, otherwise false. Defaults to true.

DisplayName string

The name to display in the address book for the user.

ForcePasswordChange bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

ImmutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

Mail string

The primary email address of the Azure AD User.

MailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

ObjectId string

The Object ID of the Azure AD User.

OnpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

OnpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

Password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

UsageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

UserPrincipalName string

The User Principal Name of the Azure AD User.

accountEnabled boolean

true if the account should be enabled, otherwise false. Defaults to true.

displayName string

The name to display in the address book for the user.

forcePasswordChange boolean

true if the User is forced to change the password during the next sign-in. Defaults to false.

immutableId string

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

mail string

The primary email address of the Azure AD User.

mailNickname string

The mail alias for the user. Defaults to the user name part of the User Principal Name.

objectId string

The Object ID of the Azure AD User.

onpremisesSamAccountName string

The on premise sam account name of the Azure AD User.

onpremisesUserPrincipalName string

The on premise user principal name of the Azure AD User.

password string

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

usageLocation string

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

userPrincipalName string

The User Principal Name of the Azure AD User.

account_enabled bool

true if the account should be enabled, otherwise false. Defaults to true.

display_name str

The name to display in the address book for the user.

force_password_change bool

true if the User is forced to change the password during the next sign-in. Defaults to false.

immutable_id str

The value used to associate an on-premises Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user’s userPrincipalName (UPN) property when creating a new user account.

mail str

The primary email address of the Azure AD User.

mail_nickname str

The mail alias for the user. Defaults to the user name part of the User Principal Name.

object_id str

The Object ID of the Azure AD User.

onpremises_sam_account_name str

The on premise sam account name of the Azure AD User.

onpremises_user_principal_name str

The on premise user principal name of the Azure AD User.

password str

The password for the User. The password must satisfy minimum requirements as specified by the password policy. The maximum length is 256 characters.

usage_location str

The usage location of the User. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: NO, JP, and GB. Cannot be reset to null once set.

user_principal_name str

The User Principal Name of the Azure AD User.

Package Details

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