Skip to main content

role_assignments

Creates, updates, deletes, gets or lists a role_assignments resource.

Overview

Namerole_assignments
TypeResource
Idazure.billing.role_assignments

Fields

The following fields are returned by SELECT queries:

The properties of the billing role assignment.

NameDatatypeDescription
propertiesobjectThe properties of the billing role assignment.
tagsobjectDictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? /

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_customerselectbillingAccountName, billingProfileName, customerName, billingRoleAssignmentNameGets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
get_by_billing_profileselectbillingAccountName, billingProfileName, billingRoleAssignmentNameGets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
list_by_customerselectbillingAccountName, billingProfileName, customerNamefilter, top, skipLists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
get_by_departmentselectbillingAccountName, departmentName, billingRoleAssignmentNameGets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
get_by_enrollment_accountselectbillingAccountName, enrollmentAccountName, billingRoleAssignmentNameGets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
list_by_billing_profileselectbillingAccountName, billingProfileNamefilter, top, skipLists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
get_by_billing_accountselectbillingAccountName, billingRoleAssignmentNameGets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
list_by_departmentselectbillingAccountName, departmentNameLists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement.
list_by_enrollment_accountselectbillingAccountName, enrollmentAccountNameLists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement.
list_by_billing_accountselectbillingAccountNamefilter, top, skipLists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
create_by_customerinsertbillingAccountName, billingProfileName, customerName, data__roleDefinitionIdAdds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
create_by_billing_profileinsertbillingAccountName, billingProfileName, data__roleDefinitionIdAdds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
create_by_billing_accountinsertbillingAccountName, data__roleDefinitionIdAdds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
delete_by_customerdeletebillingAccountName, billingProfileName, customerName, billingRoleAssignmentNameDeletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
delete_by_billing_profiledeletebillingAccountName, billingProfileName, billingRoleAssignmentNameDeletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
delete_by_departmentdeletebillingAccountName, departmentName, billingRoleAssignmentNameDeletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
delete_by_enrollment_accountdeletebillingAccountName, enrollmentAccountName, billingRoleAssignmentNameDeletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
delete_by_billing_accountdeletebillingAccountName, billingRoleAssignmentNameDeletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
resolve_by_customerexecbillingAccountName, billingProfileName, customerNameresolveScopeDisplayNames, filterLists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
resolve_by_invoice_sectionexecbillingAccountName, billingProfileName, invoiceSectionNameresolveScopeDisplayNames, filterLists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
resolve_by_billing_profileexecbillingAccountName, billingProfileNameresolveScopeDisplayNames, filterLists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
resolve_by_billing_accountexecbillingAccountNameresolveScopeDisplayNames, filterLists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
billingAccountNamestringThe ID that uniquely identifies a billing account.
billingProfileNamestringThe ID that uniquely identifies a billing profile.
billingRoleAssignmentNamestringThe ID that uniquely identifies a role assignment.
customerNamestringThe ID that uniquely identifies a customer.
departmentNamestringThe name of the department.
enrollmentAccountNamestringThe name of the enrollment account.
invoiceSectionNamestringThe ID that uniquely identifies an invoice section.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL.
resolveScopeDisplayNamesbooleanResolves the scope display name for each of the role assignments.
skipinteger (int64)The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.
topinteger (int64)The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50.

SELECT examples

Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.

SELECT
properties,
tags
FROM azure.billing.role_assignments
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingProfileName = '{{ billingProfileName }}' -- required
AND customerName = '{{ customerName }}' -- required
AND billingRoleAssignmentName = '{{ billingRoleAssignmentName }}' -- required
;

INSERT examples

Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.

INSERT INTO azure.billing.role_assignments (
data__principalPuid,
data__principalId,
data__principalTenantId,
data__roleDefinitionId,
data__scope,
data__userAuthenticationType,
data__userEmailAddress,
billingAccountName,
billingProfileName,
customerName
)
SELECT
'{{ principalPuid }}',
'{{ principalId }}',
'{{ principalTenantId }}',
'{{ roleDefinitionId }}' /* required */,
'{{ scope }}',
'{{ userAuthenticationType }}',
'{{ userEmailAddress }}',
'{{ billingAccountName }}',
'{{ billingProfileName }}',
'{{ customerName }}'
RETURNING
properties,
tags
;

DELETE examples

Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.

DELETE FROM azure.billing.role_assignments
WHERE billingAccountName = '{{ billingAccountName }}' --required
AND billingProfileName = '{{ billingProfileName }}' --required
AND customerName = '{{ customerName }}' --required
AND billingRoleAssignmentName = '{{ billingRoleAssignmentName }}' --required
;

Lifecycle Methods

Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.

EXEC azure.billing.role_assignments.resolve_by_customer 
@billingAccountName='{{ billingAccountName }}' --required,
@billingProfileName='{{ billingProfileName }}' --required,
@customerName='{{ customerName }}' --required,
@resolveScopeDisplayNames={{ resolveScopeDisplayNames }},
@filter='{{ filter }}'
;