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

azuread.DirectoryRoleAssignment

Explore with Pulumi AI

Manages a single directory role assignment within Azure Active Directory.

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: RoleManagement.ReadWrite.Directory 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

Assignment for a built-in role

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

const example = azuread.getUser({
    userPrincipalName: "jdoe@example.com",
});
const exampleDirectoryRole = new azuread.DirectoryRole("example", {displayName: "Security administrator"});
const exampleDirectoryRoleAssignment = new azuread.DirectoryRoleAssignment("example", {
    roleId: exampleDirectoryRole.templateId,
    principalObjectId: example.then(example => example.objectId),
});
Copy
import pulumi
import pulumi_azuread as azuread

example = azuread.get_user(user_principal_name="jdoe@example.com")
example_directory_role = azuread.DirectoryRole("example", display_name="Security administrator")
example_directory_role_assignment = azuread.DirectoryRoleAssignment("example",
    role_id=example_directory_role.template_id,
    principal_object_id=example.object_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
		}
		exampleDirectoryRole, err := azuread.NewDirectoryRole(ctx, "example", &azuread.DirectoryRoleArgs{
			DisplayName: pulumi.String("Security administrator"),
		})
		if err != nil {
			return err
		}
		_, err = azuread.NewDirectoryRoleAssignment(ctx, "example", &azuread.DirectoryRoleAssignmentArgs{
			RoleId:            exampleDirectoryRole.TemplateId,
			PrincipalObjectId: pulumi.String(example.ObjectId),
		})
		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 exampleDirectoryRole = new AzureAD.DirectoryRole("example", new()
    {
        DisplayName = "Security administrator",
    });

    var exampleDirectoryRoleAssignment = new AzureAD.DirectoryRoleAssignment("example", new()
    {
        RoleId = exampleDirectoryRole.TemplateId,
        PrincipalObjectId = example.Apply(getUserResult => getUserResult.ObjectId),
    });

});
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.DirectoryRole;
import com.pulumi.azuread.DirectoryRoleArgs;
import com.pulumi.azuread.DirectoryRoleAssignment;
import com.pulumi.azuread.DirectoryRoleAssignmentArgs;
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 exampleDirectoryRole = new DirectoryRole("exampleDirectoryRole", DirectoryRoleArgs.builder()
            .displayName("Security administrator")
            .build());

        var exampleDirectoryRoleAssignment = new DirectoryRoleAssignment("exampleDirectoryRoleAssignment", DirectoryRoleAssignmentArgs.builder()
            .roleId(exampleDirectoryRole.templateId())
            .principalObjectId(example.applyValue(getUserResult -> getUserResult.objectId()))
            .build());

    }
}
Copy
resources:
  exampleDirectoryRole:
    type: azuread:DirectoryRole
    name: example
    properties:
      displayName: Security administrator
  exampleDirectoryRoleAssignment:
    type: azuread:DirectoryRoleAssignment
    name: example
    properties:
      roleId: ${exampleDirectoryRole.templateId}
      principalObjectId: ${example.objectId}
variables:
  example:
    fn::invoke:
      function: azuread:getUser
      arguments:
        userPrincipalName: jdoe@example.com
Copy

Note the use of the template_id attribute when referencing built-in roles.

Assignment for a custom role

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

const example = azuread.getUser({
    userPrincipalName: "jdoe@example.com",
});
const exampleCustomDirectoryRole = new azuread.CustomDirectoryRole("example", {
    displayName: "My Custom Role",
    enabled: true,
    version: "1.0",
    permissions: [{
        allowedResourceActions: [
            "microsoft.directory/applications/basic/update",
            "microsoft.directory/applications/standard/read",
        ],
    }],
});
const exampleDirectoryRoleAssignment = new azuread.DirectoryRoleAssignment("example", {
    roleId: exampleCustomDirectoryRole.objectId,
    principalObjectId: example.then(example => example.objectId),
});
Copy
import pulumi
import pulumi_azuread as azuread

example = azuread.get_user(user_principal_name="jdoe@example.com")
example_custom_directory_role = azuread.CustomDirectoryRole("example",
    display_name="My Custom Role",
    enabled=True,
    version="1.0",
    permissions=[{
        "allowed_resource_actions": [
            "microsoft.directory/applications/basic/update",
            "microsoft.directory/applications/standard/read",
        ],
    }])
example_directory_role_assignment = azuread.DirectoryRoleAssignment("example",
    role_id=example_custom_directory_role.object_id,
    principal_object_id=example.object_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
		}
		exampleCustomDirectoryRole, err := azuread.NewCustomDirectoryRole(ctx, "example", &azuread.CustomDirectoryRoleArgs{
			DisplayName: pulumi.String("My Custom Role"),
			Enabled:     pulumi.Bool(true),
			Version:     pulumi.String("1.0"),
			Permissions: azuread.CustomDirectoryRolePermissionArray{
				&azuread.CustomDirectoryRolePermissionArgs{
					AllowedResourceActions: pulumi.StringArray{
						pulumi.String("microsoft.directory/applications/basic/update"),
						pulumi.String("microsoft.directory/applications/standard/read"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = azuread.NewDirectoryRoleAssignment(ctx, "example", &azuread.DirectoryRoleAssignmentArgs{
			RoleId:            exampleCustomDirectoryRole.ObjectId,
			PrincipalObjectId: pulumi.String(example.ObjectId),
		})
		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 exampleCustomDirectoryRole = new AzureAD.CustomDirectoryRole("example", new()
    {
        DisplayName = "My Custom Role",
        Enabled = true,
        Version = "1.0",
        Permissions = new[]
        {
            new AzureAD.Inputs.CustomDirectoryRolePermissionArgs
            {
                AllowedResourceActions = new[]
                {
                    "microsoft.directory/applications/basic/update",
                    "microsoft.directory/applications/standard/read",
                },
            },
        },
    });

    var exampleDirectoryRoleAssignment = new AzureAD.DirectoryRoleAssignment("example", new()
    {
        RoleId = exampleCustomDirectoryRole.ObjectId,
        PrincipalObjectId = example.Apply(getUserResult => getUserResult.ObjectId),
    });

});
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.CustomDirectoryRole;
import com.pulumi.azuread.CustomDirectoryRoleArgs;
import com.pulumi.azuread.inputs.CustomDirectoryRolePermissionArgs;
import com.pulumi.azuread.DirectoryRoleAssignment;
import com.pulumi.azuread.DirectoryRoleAssignmentArgs;
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 exampleCustomDirectoryRole = new CustomDirectoryRole("exampleCustomDirectoryRole", CustomDirectoryRoleArgs.builder()
            .displayName("My Custom Role")
            .enabled(true)
            .version("1.0")
            .permissions(CustomDirectoryRolePermissionArgs.builder()
                .allowedResourceActions(                
                    "microsoft.directory/applications/basic/update",
                    "microsoft.directory/applications/standard/read")
                .build())
            .build());

        var exampleDirectoryRoleAssignment = new DirectoryRoleAssignment("exampleDirectoryRoleAssignment", DirectoryRoleAssignmentArgs.builder()
            .roleId(exampleCustomDirectoryRole.objectId())
            .principalObjectId(example.applyValue(getUserResult -> getUserResult.objectId()))
            .build());

    }
}
Copy
resources:
  exampleCustomDirectoryRole:
    type: azuread:CustomDirectoryRole
    name: example
    properties:
      displayName: My Custom Role
      enabled: true
      version: '1.0'
      permissions:
        - allowedResourceActions:
            - microsoft.directory/applications/basic/update
            - microsoft.directory/applications/standard/read
  exampleDirectoryRoleAssignment:
    type: azuread:DirectoryRoleAssignment
    name: example
    properties:
      roleId: ${exampleCustomDirectoryRole.objectId}
      principalObjectId: ${example.objectId}
variables:
  example:
    fn::invoke:
      function: azuread:getUser
      arguments:
        userPrincipalName: jdoe@example.com
Copy

Scoped assignment for an application

Create DirectoryRoleAssignment Resource

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

Constructor syntax

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

@overload
def DirectoryRoleAssignment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            principal_object_id: Optional[str] = None,
                            role_id: Optional[str] = None,
                            app_scope_id: Optional[str] = None,
                            directory_scope_id: Optional[str] = None)
func NewDirectoryRoleAssignment(ctx *Context, name string, args DirectoryRoleAssignmentArgs, opts ...ResourceOption) (*DirectoryRoleAssignment, error)
public DirectoryRoleAssignment(string name, DirectoryRoleAssignmentArgs args, CustomResourceOptions? opts = null)
public DirectoryRoleAssignment(String name, DirectoryRoleAssignmentArgs args)
public DirectoryRoleAssignment(String name, DirectoryRoleAssignmentArgs args, CustomResourceOptions options)
type: azuread:DirectoryRoleAssignment
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 This property is required. DirectoryRoleAssignmentArgs
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 This property is required. DirectoryRoleAssignmentArgs
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 This property is required. DirectoryRoleAssignmentArgs
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 This property is required. DirectoryRoleAssignmentArgs
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. DirectoryRoleAssignmentArgs
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 directoryRoleAssignmentResource = new AzureAD.DirectoryRoleAssignment("directoryRoleAssignmentResource", new()
{
    PrincipalObjectId = "string",
    RoleId = "string",
    AppScopeId = "string",
    DirectoryScopeId = "string",
});
Copy
example, err := azuread.NewDirectoryRoleAssignment(ctx, "directoryRoleAssignmentResource", &azuread.DirectoryRoleAssignmentArgs{
	PrincipalObjectId: pulumi.String("string"),
	RoleId:            pulumi.String("string"),
	AppScopeId:        pulumi.String("string"),
	DirectoryScopeId:  pulumi.String("string"),
})
Copy
var directoryRoleAssignmentResource = new DirectoryRoleAssignment("directoryRoleAssignmentResource", DirectoryRoleAssignmentArgs.builder()
    .principalObjectId("string")
    .roleId("string")
    .appScopeId("string")
    .directoryScopeId("string")
    .build());
Copy
directory_role_assignment_resource = azuread.DirectoryRoleAssignment("directoryRoleAssignmentResource",
    principal_object_id="string",
    role_id="string",
    app_scope_id="string",
    directory_scope_id="string")
Copy
const directoryRoleAssignmentResource = new azuread.DirectoryRoleAssignment("directoryRoleAssignmentResource", {
    principalObjectId: "string",
    roleId: "string",
    appScopeId: "string",
    directoryScopeId: "string",
});
Copy
type: azuread:DirectoryRoleAssignment
properties:
    appScopeId: string
    directoryScopeId: string
    principalObjectId: string
    roleId: string
Copy

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

PrincipalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
AppScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
DirectoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
PrincipalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
AppScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
DirectoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
String
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. String
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. String
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principal_object_id
This property is required.
Changes to this property will trigger replacement.
str
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
role_id
This property is required.
Changes to this property will trigger replacement.
str
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
app_scope_id Changes to this property will trigger replacement. str
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directory_scope_id Changes to this property will trigger replacement. str
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
String
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. String
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. String
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the DirectoryRoleAssignment 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 DirectoryRoleAssignment Resource

Get an existing DirectoryRoleAssignment 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?: DirectoryRoleAssignmentState, opts?: CustomResourceOptions): DirectoryRoleAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_scope_id: Optional[str] = None,
        directory_scope_id: Optional[str] = None,
        principal_object_id: Optional[str] = None,
        role_id: Optional[str] = None) -> DirectoryRoleAssignment
func GetDirectoryRoleAssignment(ctx *Context, name string, id IDInput, state *DirectoryRoleAssignmentState, opts ...ResourceOption) (*DirectoryRoleAssignment, error)
public static DirectoryRoleAssignment Get(string name, Input<string> id, DirectoryRoleAssignmentState? state, CustomResourceOptions? opts = null)
public static DirectoryRoleAssignment get(String name, Output<String> id, DirectoryRoleAssignmentState state, CustomResourceOptions options)
resources:  _:    type: azuread:DirectoryRoleAssignment    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:
AppScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
DirectoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
PrincipalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId Changes to this property will trigger replacement. string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
AppScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
DirectoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
PrincipalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId Changes to this property will trigger replacement. string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. String
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. String
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. String
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. string
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. string
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. string
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
app_scope_id Changes to this property will trigger replacement. str
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directory_scope_id Changes to this property will trigger replacement. str
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principal_object_id Changes to this property will trigger replacement. str
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
role_id Changes to this property will trigger replacement. str
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.
appScopeId Changes to this property will trigger replacement. String
Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
directoryScopeId Changes to this property will trigger replacement. String
Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. String
The template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

Import

Directory role assignments can be imported using the ID of the assignment, e.g.

$ pulumi import azuread:index/directoryRoleAssignment:DirectoryRoleAssignment example ePROZI_iKE653D_d6aoLHyr-lKgHI8ZGiIdz8CLVcng-1
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.