Users
π Azure (Microsoft Entra ID) β User Management¶
In Azure (Microsoft Entra ID), a user is an identity representing an individual or application that can authenticate and access resources within an organization.
π§βπ€βπ§ Types of Users in Azure Entra ID¶
-
Member Users
Internal users in the organization (e.g., employees). -
Guest Users
External users (e.g., partners, vendors) invited for collaboration. -
Service Principals
Identities for applications or services to authenticate and access resources. -
Managed Identities
System-assigned identities used by Azure services to securely access resources without storing credentials.
Users can be assigned roles, permissions, and access to applications, resources, and services based on organizational policies. π

π€ Create Users in Entra ID¶
-
Admin logs into the Entra ID Portal
-
Navigates to "Users" section
-
Clicks "New User"
-
Enters user details (Name, Username, etc.)
-
Assigns roles and permissions
-
Saves the new user
-
User receives a welcome email
-
User logs in and completes setup β
β Delete Users in Entra ID¶
-
Admin logs into the Entra ID Portal
-
Navigates to "Users" section
-
Selects the user to remove
-
Clicks "Delete"
-
Confirms the deletion
-
User is moved to "Deleted Users"
-
(Optional) Admin can permanently delete or restore the user
βοΈ Terraform: Manage Users in Azure Entra ID¶
π§ Prerequisites¶
π€ Create a Member User¶
resource "azuread_user" "example_user" {
user_principal_name = "john.doe@yourdomain.com"
display_name = "John Doe"
password = "P@ssw0rd1234!"
force_password_change = true
mail_nickname = "johndoe"
account_enabled = true
}
π‘οΈ Assign a Role to the User (e.g., Global Reader)¶
data "azuread_directory_role" "global_reader" {
display_name = "Global Reader"
}
resource "azuread_directory_role_member" "assign_role" {
role_object_id = data.azuread_directory_role.global_reader.object_id
member_object_id = azuread_user.example_user.object_id
}
β Delete a User¶
To delete a user, simply remove the azuread_user resource from your Terraform code and run:
Terraform will then remove the user from Entra ID.
π Notes¶
-
Ensure the password complies with your tenantβs complexity requirements.
-
The user receives an email only if email is routable and configured.
-
Roles must be enabled in the tenant using Azure Portal or CLI if not already available.