Role Assignments - Create By Id

Creates a role assignment by ID.

PUT https://management.azure.com/{roleAssignmentId}?api-version=2015-07-01

URI Parameters

Name In Required Type Description
roleAssignmentId
path True
  • string

The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}.

api-version
query True
  • string

The API version to use for this operation.

Request Body

Name Required Type Description
properties True

Role assignment properties.

Responses

Name Type Description
201 Created

Created - Returns the role assignment.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

GetConfigurations

Sample Request

PUT https://management.azure.com/roleAssignmentId?api-version=2015-07-01
{
  "properties": {
    "roleDefinitionId": "/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f/providers/Microsoft.Authorization/roleDefinitions/de139f84-1756-47ae-9be6-808fbbe84772",
    "principalId": "d93a38bc-d029-4160-bfb0-fbda779ac214"
  }
}

Sample Response

{
  "properties": {
    "roleDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/roleDefinitions/roledefinitionId",
    "principalId": "Pid",
    "scope": "/subscriptions/subId/resourcegroups/rgname"
  },
  "id": "/subscriptions/subId/resourcegroups/rgname/providers/Microsoft.Authorization/roleAssignments/roleassignmentId",
  "type": "Microsoft.Authorization/roleAssignments",
  "name": "roleassignmentId"
}

Definitions

RoleAssignment

Role Assignments

RoleAssignmentCreateParameters

Role assignment create parameters.

RoleAssignmentProperties

Role assignment properties.

RoleAssignmentPropertiesWithScope

Role assignment properties with scope.

RoleAssignment

Role Assignments

Name Type Description
id
  • string

The role assignment ID.

name
  • string

The role assignment name.

properties

Role assignment properties.

type
  • string

The role assignment type.

RoleAssignmentCreateParameters

Role assignment create parameters.

Name Type Description
properties

Role assignment properties.

RoleAssignmentProperties

Role assignment properties.

Name Type Description
principalId
  • string

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.

roleDefinitionId
  • string

The role definition ID used in the role assignment.

RoleAssignmentPropertiesWithScope

Role assignment properties with scope.

Name Type Description
principalId
  • string

The principal ID.

roleDefinitionId
  • string

The role definition ID.

scope
  • string

The role assignment scope.