Role Assignments - Create Role Assignment

Create role assignment.

PUT {endpoint}/roleAssignments/{roleAssignmentId}?api-version=2020-12-01

URI Parameters

Name In Required Type Description
endpoint
path True

string

The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.

roleAssignmentId
path True

string

minLength: 1

The ID of the role assignment.

api-version
query True

string

The Synapse client API Version.

Request Body

Media Types: "application/json", "text/json"

Name Type Description
request

RoleAssignmentRequest

Details of role id, scope and object id.

Responses

Name Type Description
200 OK

RoleAssignmentDetails

Success response.

Media Types: "application/json", "text/json"

Other Status Codes

ErrorContract

Error response describing why the operation failed.

Media Types: "application/json", "text/json"

Examples

Create role assignment

Sample request

PUT exampleWorkspace.dev.azuresynapse.net/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2020-12-01

{
  "roleId": "00000000-0000-0000-0000-000000000000",
  "principalId": "00000000-0000-0000-0000-000000000000",
  "scope": "workspaces/exampleWorkspace",
  "principalType": "User || Group || ServicePrincipal"
}

Sample response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "roleDefinitionId": "00000000-0000-0000-0000-000000000000",
  "principalId": "00000000-0000-0000-0000-000000000000",
  "scope": "workspaces/exampleWorkspace",
  "principalType": "User || Group || ServicePrincipal"
}
{
  "error": {
    "code": "Error code",
    "message": "Error message"
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorContract

Error details.

ErrorResponse

Error Response

RoleAssignmentDetails

Role Assignment response details

RoleAssignmentRequest

Details of role id, scope and object id.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorContract

Error details.

Name Type Description
error

ErrorResponse

Error Response
The error details.

ErrorResponse

Error Response

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

RoleAssignmentDetails

Role Assignment response details

Name Type Description
id

string

Role Assignment ID

principalId

string (uuid)

Object ID of the AAD principal or security-group

principalType

string

Type of the principal Id: User, Group or ServicePrincipal

roleDefinitionId

string (uuid)

Role ID of the Synapse Built-In Role

scope

string

Scope at the role assignment is created

RoleAssignmentRequest

Details of role id, scope and object id.

Name Type Description
principalId

string (uuid)

Object ID of the AAD principal or security-group

principalType

string

Type of the principal Id: User, Group or ServicePrincipal

roleId

string (uuid)

Role ID of the Synapse Built-In Role

scope

string

Scope at which the role assignment is created