---
title: "PUT /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}"
method: PUT
path: "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}"
---

# PUT /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}

`PUT /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}`

Creates a role assignment.

## Path parameters

- `scope` string, required
- `roleAssignmentName` string, required

## Query parameters

- `api-version` string, required

## Request body

- RoleAssignmentCreateParameters — Role assignment create parameters.
  - `properties` RoleAssignmentProperties, required — Role assignment properties.
    - `roleDefinitionId` string, required — The role definition ID used in the role assignment.
    - `principalId` string, required — The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group.

## Response `201`

The request has succeeded and a new resource has been created as a result.

- RoleAssignment — Role Assignments
  - `id` string — The role assignment ID.
  - `name` string — The role assignment name.
  - `type` string — The role assignment type.
  - `properties` RoleAssignmentPropertiesWithScope — Role assignment properties with scope.
    - `scope` '/' | '/keys' — The role scope.
    - `roleDefinitionId` string — The role definition ID.
    - `principalId` string — The principal ID.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/keyvault-administration.md) · [All operations](https://skmtc.dev/azure/apis/keyvault-administration/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/keyvault-administration/revisions/207d840b9335/schema)
