RoleAssignments interface

Interface representing a RoleAssignments.

Methods

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

Creates a role assignment.

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

Creates a role assignment by ID.

delete(string, string, RoleAssignmentsDeleteOptionalParams)

Deletes a role assignment.

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

Deletes a role assignment.

get(string, string, RoleAssignmentsGetOptionalParams)

Get the specified role assignment.

getById(string, RoleAssignmentsGetByIdOptionalParams)

Gets a role assignment by ID.

list(RoleAssignmentsListOptionalParams)

Gets all role assignments for the subscription.

listForResource(string, string, string, string, string, RoleAssignmentsListForResourceOptionalParams)

Gets role assignments for a resource.

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

Gets role assignments for a resource group.

listForScope(string, RoleAssignmentsListForScopeOptionalParams)

Gets role assignments for a scope.

Method Details

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

Creates a role assignment.

function create(scope: string, roleAssignmentName: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateOptionalParams): Promise<RoleAssignment>

Parameters

scope

string

The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.

roleAssignmentName

string

A GUID for the role assignment to create. The name must be unique and different for each role assignment.

parameters
RoleAssignmentCreateParameters

Parameters for the role assignment.

options
RoleAssignmentsCreateOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

Creates a role assignment by ID.

function createById(roleAssignmentId: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateByIdOptionalParams): Promise<RoleAssignment>

Parameters

roleAssignmentId

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}.

parameters
RoleAssignmentCreateParameters

Parameters for the role assignment.

options
RoleAssignmentsCreateByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

delete(string, string, RoleAssignmentsDeleteOptionalParams)

Deletes a role assignment.

function delete(scope: string, roleAssignmentName: string, options?: RoleAssignmentsDeleteOptionalParams): Promise<RoleAssignment>

Parameters

scope

string

The scope of the role assignment to delete.

roleAssignmentName

string

The name of the role assignment to delete.

options
RoleAssignmentsDeleteOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

Deletes a role assignment.

function deleteById(roleAssignmentId: string, options?: RoleAssignmentsDeleteByIdOptionalParams): Promise<RoleAssignment>

Parameters

roleAssignmentId

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}.

options
RoleAssignmentsDeleteByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

get(string, string, RoleAssignmentsGetOptionalParams)

Get the specified role assignment.

function get(scope: string, roleAssignmentName: string, options?: RoleAssignmentsGetOptionalParams): Promise<RoleAssignment>

Parameters

scope

string

The scope of the role assignment.

roleAssignmentName

string

The name of the role assignment to get.

options
RoleAssignmentsGetOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

getById(string, RoleAssignmentsGetByIdOptionalParams)

Gets a role assignment by ID.

function getById(roleAssignmentId: string, options?: RoleAssignmentsGetByIdOptionalParams): Promise<RoleAssignment>

Parameters

roleAssignmentId

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}.

options
RoleAssignmentsGetByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

list(RoleAssignmentsListOptionalParams)

Gets all role assignments for the subscription.

function list(options?: RoleAssignmentsListOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

Parameters

options
RoleAssignmentsListOptionalParams

The options parameters.

Returns

listForResource(string, string, string, string, string, RoleAssignmentsListForResourceOptionalParams)

Gets role assignments for a resource.

function listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: RoleAssignmentsListForResourceOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

resourceProviderNamespace

string

The namespace of the resource provider.

parentResourcePath

string

The parent resource identity.

resourceType

string

The resource type of the resource.

resourceName

string

The name of the resource to get role assignments for.

options
RoleAssignmentsListForResourceOptionalParams

The options parameters.

Returns

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

Gets role assignments for a resource group.

function listForResourceGroup(resourceGroupName: string, options?: RoleAssignmentsListForResourceGroupOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

options
RoleAssignmentsListForResourceGroupOptionalParams

The options parameters.

Returns

listForScope(string, RoleAssignmentsListForScopeOptionalParams)

Gets role assignments for a scope.

function listForScope(scope: string, options?: RoleAssignmentsListForScopeOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

Parameters

scope

string

The scope of the role assignments.

options
RoleAssignmentsListForScopeOptionalParams

The options parameters.

Returns