1. Packages
  2. Packages
  3. Power Platform
  4. API Docs
  5. RoleAssignment
Viewing docs for Power Platform v0.3.3
published on Monday, May 18, 2026 by rpothin
powerplatform logo
Viewing docs for Power Platform v0.3.3
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:

    PrincipalObjectId string
    The object ID of the principal (user, group, or service principal) to assign the role to.
    PrincipalType string
    The type of the principal: User, Group, or ServicePrincipal.
    RoleDefinitionId string
    The ID of the role definition to assign.
    Scope string
    The scope of the role assignment (e.g., tenant, environment, or environment group).
    PrincipalObjectId string
    The object ID of the principal (user, group, or service principal) to assign the role to.
    PrincipalType string
    The type of the principal: User, Group, or ServicePrincipal.
    RoleDefinitionId string
    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_id string
    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_id string
    The ID of the role definition to assign.
    scope string
    The scope of the role assignment (e.g., tenant, environment, or environment group).
    principalObjectId String
    The object ID of the principal (user, group, or service principal) to assign the role to.
    principalType String
    The type of the principal: User, Group, or ServicePrincipal.
    roleDefinitionId String
    The ID of the role definition to assign.
    scope String
    The scope of the role assignment (e.g., tenant, environment, or environment group).
    principalObjectId string
    The object ID of the principal (user, group, or service principal) to assign the role to.
    principalType string
    The type of the principal: User, Group, or ServicePrincipal.
    roleDefinitionId string
    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_id str
    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_id str
    The ID of the role definition to assign.
    scope str
    The scope of the role assignment (e.g., tenant, environment, or environment group).
    principalObjectId String
    The object ID of the principal (user, group, or service principal) to assign the role to.
    principalType String
    The type of the principal: User, Group, or ServicePrincipal.
    roleDefinitionId String
    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.
    CreatedOn string
    The timestamp when the role assignment was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreatedOn string
    The timestamp when the role assignment was created.
    id string
    The provider-assigned unique ID for this managed resource.
    created_on string
    The timestamp when the role assignment was created.
    id String
    The provider-assigned unique ID for this managed resource.
    createdOn String
    The timestamp when the role assignment was created.
    id string
    The provider-assigned unique ID for this managed resource.
    createdOn 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.
    id String
    The provider-assigned unique ID for this managed resource.
    createdOn String
    The timestamp when the role assignment was created.

    Package Details

    Repository
    powerplatform rpothin/pulumi-powerplatform
    License
    MIT
    powerplatform logo
    Viewing docs for Power Platform v0.3.3
    published on Monday, May 18, 2026 by rpothin

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial