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.Allwithin theWindows Azure Active DirectoryAPI.
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);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:
- Display
Name 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.
- User
Principal stringName The User Principal Name of the Azure AD User.
- Account
Enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- Force
Password boolChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- Immutable
Id 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
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- Usage
Location 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, andGB. Cannot be reset to null once set.
- Display
Name 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.
- User
Principal stringName The User Principal Name of the Azure AD User.
- Account
Enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- Force
Password boolChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- Immutable
Id 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
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- Usage
Location 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, andGB. Cannot be reset to null once set.
- display
Name 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.
- user
Principal stringName The User Principal Name of the Azure AD User.
- account
Enabled boolean trueif the account should be enabled, otherwisefalse. Defaults totrue.- force
Password booleanChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- immutable
Id 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
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- usage
Location 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, andGB. 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_ strname The User Principal Name of the Azure AD User.
- account_
enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- force_
password_ boolchange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- 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, andGB. 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.
- Object
Id string The Object ID of the Azure AD User.
- Onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- Onpremises
User stringPrincipal Name 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.
- Object
Id string The Object ID of the Azure AD User.
- Onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- Onpremises
User stringPrincipal Name 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.
- object
Id string The Object ID of the Azure AD User.
- onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- onpremises
User stringPrincipal Name 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_ straccount_ name The on premise sam account name of the Azure AD User.
- onpremises_
user_ strprincipal_ name 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): Userstatic 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);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:
- Account
Enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- Display
Name string The name to display in the address book for the user.
- Force
Password boolChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- Immutable
Id 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.
- Mail
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- Object
Id string The Object ID of the Azure AD User.
- Onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- Onpremises
User stringPrincipal Name 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.
- Usage
Location 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, andGB. Cannot be reset to null once set.- User
Principal stringName The User Principal Name of the Azure AD User.
- Account
Enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- Display
Name string The name to display in the address book for the user.
- Force
Password boolChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- Immutable
Id 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.
- Mail
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- Object
Id string The Object ID of the Azure AD User.
- Onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- Onpremises
User stringPrincipal Name 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.
- Usage
Location 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, andGB. Cannot be reset to null once set.- User
Principal stringName The User Principal Name of the Azure AD User.
- account
Enabled boolean trueif the account should be enabled, otherwisefalse. Defaults totrue.- display
Name string The name to display in the address book for the user.
- force
Password booleanChange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- immutable
Id 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.
- mail
Nickname string The mail alias for the user. Defaults to the user name part of the User Principal Name.
- object
Id string The Object ID of the Azure AD User.
- onpremises
Sam stringAccount Name The on premise sam account name of the Azure AD User.
- onpremises
User stringPrincipal Name 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.
- usage
Location 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, andGB. Cannot be reset to null once set.- user
Principal stringName The User Principal Name of the Azure AD User.
- account_
enabled bool trueif the account should be enabled, otherwisefalse. Defaults totrue.- display_
name str The name to display in the address book for the user.
- force_
password_ boolchange trueif the User is forced to change the password during the next sign-in. Defaults tofalse.- 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_ straccount_ name The on premise sam account name of the Azure AD User.
- onpremises_
user_ strprincipal_ name 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, andGB. Cannot be reset to null once set.- user_
principal_ strname 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
azureadTerraform Provider.