RoleAssignments interface

Interface representing a RoleAssignments.

Methods

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

Create or update a role assignment by scope and name.

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

Create or update a role assignment by ID.

delete(string, string, RoleAssignmentsDeleteOptionalParams)

Delete a role assignment by scope and name.

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

Delete a role assignment by ID.

get(string, string, RoleAssignmentsGetOptionalParams)

Get a role assignment by scope and name.

getById(string, RoleAssignmentsGetByIdOptionalParams)

Get a role assignment by ID.

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

List all role assignments that apply to a resource.

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

List all role assignments that apply to a resource group.

listForScope(string, RoleAssignmentsListForScopeOptionalParams)

List all role assignments that apply to a scope.

listForSubscription(RoleAssignmentsListForSubscriptionOptionalParams)

List all role assignments that apply to a subscription.

Method Details

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

Create or update a role assignment by scope and name.

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

Parameters

scope

string

The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

The name of the role assignment. It can be any valid GUID.

parameters
RoleAssignmentCreateParameters

Parameters for the role assignment.

options
RoleAssignmentsCreateOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

Create or update 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 scope, resource name, and resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

parameters
RoleAssignmentCreateParameters

Parameters for the role assignment.

options
RoleAssignmentsCreateByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

delete(string, string, RoleAssignmentsDeleteOptionalParams)

Delete a role assignment by scope and name.

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

Parameters

scope

string

The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

The name of the role assignment. It can be any valid GUID.

options
RoleAssignmentsDeleteOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

Delete a role assignment by ID.

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

Parameters

roleAssignmentId

string

The fully qualified ID of the role assignment including scope, resource name, and resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

options
RoleAssignmentsDeleteByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

get(string, string, RoleAssignmentsGetOptionalParams)

Get a role assignment by scope and name.

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

Parameters

scope

string

The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

The name of the role assignment. It can be any valid GUID.

options
RoleAssignmentsGetOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

getById(string, RoleAssignmentsGetByIdOptionalParams)

Get 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 scope, resource name, and resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

options
RoleAssignmentsGetByIdOptionalParams

The options parameters.

Returns

Promise<RoleAssignment>

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

List all role assignments that apply to a resource.

function listForResource(resourceGroupName: string, resourceProviderNamespace: 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.

resourceType

string

The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites).

resourceName

string

The resource name.

options
RoleAssignmentsListForResourceOptionalParams

The options parameters.

Returns

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

List all role assignments that apply to 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)

List all role assignments that apply to a scope.

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

Parameters

scope

string

The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

options
RoleAssignmentsListForScopeOptionalParams

The options parameters.

Returns

listForSubscription(RoleAssignmentsListForSubscriptionOptionalParams)

List all role assignments that apply to a subscription.

function listForSubscription(options?: RoleAssignmentsListForSubscriptionOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

Parameters

options
RoleAssignmentsListForSubscriptionOptionalParams

The options parameters.

Returns