published on Monday, May 18, 2026 by rpothin
published on Monday, May 18, 2026 by rpothin
Assigns a role to a principal (user, group, or service principal) at a specified scope. Role assignments are immutable — any change to inputs triggers replacement.
Create RoleAssignment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RoleAssignment(name: string, args: RoleAssignmentArgs, opts?: CustomResourceOptions);@overload
def RoleAssignment(resource_name: str,
args: RoleAssignmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RoleAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
principal_object_id: Optional[str] = None,
principal_type: Optional[str] = None,
role_definition_id: Optional[str] = None,
scope: Optional[str] = None)func NewRoleAssignment(ctx *Context, name string, args RoleAssignmentArgs, opts ...ResourceOption) (*RoleAssignment, error)public RoleAssignment(string name, RoleAssignmentArgs args, CustomResourceOptions? opts = null)
public RoleAssignment(String name, RoleAssignmentArgs args)
public RoleAssignment(String name, RoleAssignmentArgs args, CustomResourceOptions options)
type: powerplatform:RoleAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "powerplatform_roleassignment" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RoleAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RoleAssignmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RoleAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleAssignmentArgs
- 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 roleAssignmentResource = new Powerplatform.RoleAssignment("roleAssignmentResource", new()
{
PrincipalObjectId = "string",
PrincipalType = "string",
RoleDefinitionId = "string",
Scope = "string",
});
example, err := powerplatform.NewRoleAssignment(ctx, "roleAssignmentResource", &powerplatform.RoleAssignmentArgs{
PrincipalObjectId: pulumi.String("string"),
PrincipalType: pulumi.String("string"),
RoleDefinitionId: pulumi.String("string"),
Scope: pulumi.String("string"),
})
resource "powerplatform_roleassignment" "roleAssignmentResource" {
principal_object_id = "string"
principal_type = "string"
role_definition_id = "string"
scope = "string"
}
var roleAssignmentResource = new RoleAssignment("roleAssignmentResource", RoleAssignmentArgs.builder()
.principalObjectId("string")
.principalType("string")
.roleDefinitionId("string")
.scope("string")
.build());
role_assignment_resource = powerplatform.RoleAssignment("roleAssignmentResource",
principal_object_id="string",
principal_type="string",
role_definition_id="string",
scope="string")
const roleAssignmentResource = new powerplatform.RoleAssignment("roleAssignmentResource", {
principalObjectId: "string",
principalType: "string",
roleDefinitionId: "string",
scope: "string",
});
type: powerplatform:RoleAssignment
properties:
principalObjectId: string
principalType: string
roleDefinitionId: string
scope: string
RoleAssignment 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 RoleAssignment resource accepts the following input properties:
- Principal
Object stringId - The object ID of the principal (user, group, or service principal) to assign the role to.
- Principal
Type string - The type of the principal: User, Group, or ServicePrincipal.
- Role
Definition stringId - The ID of the role definition to assign.
- Scope string
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- Principal
Object stringId - The object ID of the principal (user, group, or service principal) to assign the role to.
- Principal
Type string - The type of the principal: User, Group, or ServicePrincipal.
- Role
Definition stringId - The ID of the role definition to assign.
- Scope string
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- principal_
object_ stringid - The object ID of the principal (user, group, or service principal) to assign the role to.
- principal_
type string - The type of the principal: User, Group, or ServicePrincipal.
- role_
definition_ stringid - The ID of the role definition to assign.
- scope string
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- principal
Object StringId - The object ID of the principal (user, group, or service principal) to assign the role to.
- principal
Type String - The type of the principal: User, Group, or ServicePrincipal.
- role
Definition StringId - The ID of the role definition to assign.
- scope String
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- principal
Object stringId - The object ID of the principal (user, group, or service principal) to assign the role to.
- principal
Type string - The type of the principal: User, Group, or ServicePrincipal.
- role
Definition stringId - The ID of the role definition to assign.
- scope string
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- principal_
object_ strid - The object ID of the principal (user, group, or service principal) to assign the role to.
- principal_
type str - The type of the principal: User, Group, or ServicePrincipal.
- role_
definition_ strid - The ID of the role definition to assign.
- scope str
- The scope of the role assignment (e.g., tenant, environment, or environment group).
- principal
Object StringId - The object ID of the principal (user, group, or service principal) to assign the role to.
- principal
Type String - The type of the principal: User, Group, or ServicePrincipal.
- role
Definition StringId - The ID of the role definition to assign.
- scope String
- The scope of the role assignment (e.g., tenant, environment, or environment group).
Outputs
All input properties are implicitly available as output properties. Additionally, the RoleAssignment resource produces the following output properties:
- id string
- The provider-assigned unique ID for this managed resource.
- created_
on string - The timestamp when the role assignment was created.
- id str
- The provider-assigned unique ID for this managed resource.
- created_
on str - The timestamp when the role assignment was created.
Package Details
- Repository
- powerplatform rpothin/pulumi-powerplatform
- License
- MIT
published on Monday, May 18, 2026 by rpothin