1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. AdministrativeUnitMember
Azure Active Directory (Azure AD) v6.4.0 published on Monday, Apr 7, 2025 by Pulumi

azuread.AdministrativeUnitMember

Explore with Pulumi AI

Manages a single administrative unit membership within Azure Active Directory.

Warning Do not use this resource at the same time as the members property of the azuread.AdministrativeUnit resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.

API Permissions

The following API permissions are required in order to use this resource.

When authenticated with a service principal, this resource requires one of the following application roles: AdministrativeUnit.ReadWrite.All or Directory.ReadWrite.All

When authenticated with a user principal, this resource requires one of the following directory roles: Privileged Role Administrator or Global Administrator

Example Usage

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

const example = azuread.getUser({
    userPrincipalName: "jdoe@example.com",
});
const exampleAdministrativeUnit = new azuread.AdministrativeUnit("example", {displayName: "Example-AU"});
const exampleAdministrativeUnitMember = new azuread.AdministrativeUnitMember("example", {
    administrativeUnitObjectId: exampleAdministrativeUnit.id,
    memberObjectId: example.then(example => example.id),
});
Copy
import pulumi
import pulumi_azuread as azuread

example = azuread.get_user(user_principal_name="jdoe@example.com")
example_administrative_unit = azuread.AdministrativeUnit("example", display_name="Example-AU")
example_administrative_unit_member = azuread.AdministrativeUnitMember("example",
    administrative_unit_object_id=example_administrative_unit.id,
    member_object_id=example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuread.LookupUser(ctx, &azuread.LookupUserArgs{
			UserPrincipalName: pulumi.StringRef("jdoe@example.com"),
		}, nil)
		if err != nil {
			return err
		}
		exampleAdministrativeUnit, err := azuread.NewAdministrativeUnit(ctx, "example", &azuread.AdministrativeUnitArgs{
			DisplayName: pulumi.String("Example-AU"),
		})
		if err != nil {
			return err
		}
		_, err = azuread.NewAdministrativeUnitMember(ctx, "example", &azuread.AdministrativeUnitMemberArgs{
			AdministrativeUnitObjectId: exampleAdministrativeUnit.ID(),
			MemberObjectId:             pulumi.String(example.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;

return await Deployment.RunAsync(() => 
{
    var example = AzureAD.GetUser.Invoke(new()
    {
        UserPrincipalName = "jdoe@example.com",
    });

    var exampleAdministrativeUnit = new AzureAD.AdministrativeUnit("example", new()
    {
        DisplayName = "Example-AU",
    });

    var exampleAdministrativeUnitMember = new AzureAD.AdministrativeUnitMember("example", new()
    {
        AdministrativeUnitObjectId = exampleAdministrativeUnit.Id,
        MemberObjectId = example.Apply(getUserResult => getUserResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetUserArgs;
import com.pulumi.azuread.AdministrativeUnit;
import com.pulumi.azuread.AdministrativeUnitArgs;
import com.pulumi.azuread.AdministrativeUnitMember;
import com.pulumi.azuread.AdministrativeUnitMemberArgs;
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 = AzureadFunctions.getUser(GetUserArgs.builder()
            .userPrincipalName("jdoe@example.com")
            .build());

        var exampleAdministrativeUnit = new AdministrativeUnit("exampleAdministrativeUnit", AdministrativeUnitArgs.builder()
            .displayName("Example-AU")
            .build());

        var exampleAdministrativeUnitMember = new AdministrativeUnitMember("exampleAdministrativeUnitMember", AdministrativeUnitMemberArgs.builder()
            .administrativeUnitObjectId(exampleAdministrativeUnit.id())
            .memberObjectId(example.applyValue(getUserResult -> getUserResult.id()))
            .build());

    }
}
Copy
resources:
  exampleAdministrativeUnit:
    type: azuread:AdministrativeUnit
    name: example
    properties:
      displayName: Example-AU
  exampleAdministrativeUnitMember:
    type: azuread:AdministrativeUnitMember
    name: example
    properties:
      administrativeUnitObjectId: ${exampleAdministrativeUnit.id}
      memberObjectId: ${example.id}
variables:
  example:
    fn::invoke:
      function: azuread:getUser
      arguments:
        userPrincipalName: jdoe@example.com
Copy

Create AdministrativeUnitMember Resource

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

Constructor syntax

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

@overload
def AdministrativeUnitMember(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             administrative_unit_object_id: Optional[str] = None,
                             member_object_id: Optional[str] = None)
func NewAdministrativeUnitMember(ctx *Context, name string, args *AdministrativeUnitMemberArgs, opts ...ResourceOption) (*AdministrativeUnitMember, error)
public AdministrativeUnitMember(string name, AdministrativeUnitMemberArgs? args = null, CustomResourceOptions? opts = null)
public AdministrativeUnitMember(String name, AdministrativeUnitMemberArgs args)
public AdministrativeUnitMember(String name, AdministrativeUnitMemberArgs args, CustomResourceOptions options)
type: azuread:AdministrativeUnitMember
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 AdministrativeUnitMemberArgs
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 AdministrativeUnitMemberArgs
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 AdministrativeUnitMemberArgs
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 AdministrativeUnitMemberArgs
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. AdministrativeUnitMemberArgs
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 administrativeUnitMemberResource = new AzureAD.AdministrativeUnitMember("administrativeUnitMemberResource", new()
{
    AdministrativeUnitObjectId = "string",
    MemberObjectId = "string",
});
Copy
example, err := azuread.NewAdministrativeUnitMember(ctx, "administrativeUnitMemberResource", &azuread.AdministrativeUnitMemberArgs{
	AdministrativeUnitObjectId: pulumi.String("string"),
	MemberObjectId:             pulumi.String("string"),
})
Copy
var administrativeUnitMemberResource = new AdministrativeUnitMember("administrativeUnitMemberResource", AdministrativeUnitMemberArgs.builder()
    .administrativeUnitObjectId("string")
    .memberObjectId("string")
    .build());
Copy
administrative_unit_member_resource = azuread.AdministrativeUnitMember("administrativeUnitMemberResource",
    administrative_unit_object_id="string",
    member_object_id="string")
Copy
const administrativeUnitMemberResource = new azuread.AdministrativeUnitMember("administrativeUnitMemberResource", {
    administrativeUnitObjectId: "string",
    memberObjectId: "string",
});
Copy
type: azuread:AdministrativeUnitMember
properties:
    administrativeUnitObjectId: string
    memberObjectId: string
Copy

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

AdministrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
MemberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

AdministrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
MemberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. String
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. String

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrative_unit_object_id Changes to this property will trigger replacement. str
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
member_object_id Changes to this property will trigger replacement. str

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. String
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. String

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing AdministrativeUnitMember Resource

Get an existing AdministrativeUnitMember 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?: AdministrativeUnitMemberState, opts?: CustomResourceOptions): AdministrativeUnitMember
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        administrative_unit_object_id: Optional[str] = None,
        member_object_id: Optional[str] = None) -> AdministrativeUnitMember
func GetAdministrativeUnitMember(ctx *Context, name string, id IDInput, state *AdministrativeUnitMemberState, opts ...ResourceOption) (*AdministrativeUnitMember, error)
public static AdministrativeUnitMember Get(string name, Input<string> id, AdministrativeUnitMemberState? state, CustomResourceOptions? opts = null)
public static AdministrativeUnitMember get(String name, Output<String> id, AdministrativeUnitMemberState state, CustomResourceOptions options)
resources:  _:    type: azuread:AdministrativeUnitMember    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:
AdministrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
MemberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

AdministrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
MemberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. String
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. String

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. string
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. string

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrative_unit_object_id Changes to this property will trigger replacement. str
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
member_object_id Changes to this property will trigger replacement. str

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

administrativeUnitObjectId Changes to this property will trigger replacement. String
The object ID of the administrative unit you want to add the member to. Changing this forces a new resource to be created.
memberObjectId Changes to this property will trigger replacement. String

The object ID of the user or group you want to add as a member of the administrative unit. Changing this forces a new resource to be created.

Caution When using the azuread.AdministrativeUnitMember resource to manage Administrative Unit membership for a group, you will need to use an ignore_changes = [administrative_unit_ids] lifecycle meta argument for the azuread.Group resource, in order to avoid a persistent diff.

Import

Administrative unit members can be imported using the object ID of the administrative unit and the object ID of the member, e.g.

$ pulumi import azuread:index/administrativeUnitMember:AdministrativeUnitMember example /directory/administrativeUnits/00000000-0000-0000-0000-000000000000/members/11111111-1111-1111-1111-111111111111
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Active Directory (Azure AD) pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.