Skip to main content

billing_role_assignments

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

Overview

Namebilling_role_assignments
TypeResource
Idazure.billing.billing_role_assignments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
billingAccountDisplayNamestringThe name of the billing account.
billingAccountIdstringThe fully qualified ID that uniquely identifies a billing account.
billingProfileDisplayNamestringThe name of the billing profile.
billingProfileIdstringThe fully qualified ID that uniquely identifies a billing profile.
billingRequestIdstringThe ID of the billing request that was created for the role assignment. This is only applicable to cross tenant role assignments or role assignments created through the billing request.
createdByPrincipalIdstringThe object ID of the user who created the role assignment.
createdByPrincipalPuidstringThe principal PUID of the user who created the role assignment.
createdByPrincipalTenantIdstringThe tenant Id of the user who created the role assignment.
createdByUserEmailAddressstringThe email address of the user who created the role assignment. This is supported only for billing accounts with agreement type Enterprise Agreement.
createdOnstring (date-time)The date the role assignment was created.
customerDisplayNamestringThe name of the customer.
customerIdstringThe fully qualified ID that uniquely identifies a customer.
invoiceSectionDisplayNamestringThe name of the invoice section.
invoiceSectionIdstringThe fully qualified ID that uniquely identifies an invoice section.
modifiedByPrincipalIdstringThe principal PUID of the user who modified the role assignment.
modifiedByPrincipalPuidstringThe principal PUID of the user who modified the role assignment.
modifiedByPrincipalTenantIdstringThe tenant Id of the user who modified the role assignment.
modifiedByUserEmailAddressstringThe email address of the user who modified the role assignment. This is supported only for billing accounts with agreement type Enterprise Agreement.
modifiedOnstring (date-time)The date the role assignment was modified.
principalDisplayNamestringThe display name of the principal to whom the role was assigned.
principalIdstringThe object id of the user to whom the role was assigned.
principalPuidstringThe principal PUID of the user to whom the role was assigned.
principalTenantIdstringThe principal tenant id of the user to whom the role was assigned.
principalTenantNamestringThe friendly name of the tenant of the user to whom the role was assigned. This will be 'Primary Tenant' for the primary tenant of the billing account.
principalTypestringThe type of a role Assignment. Known values are: "Unknown", "None", "User", "Group", "DirectoryRole", "ServicePrincipal", and "Everyone". (Unknown, None, User, Group, DirectoryRole, ServicePrincipal, Everyone)
provisioningStatestringThe provisioning state of the resource during a long-running operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending", "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired". (Succeeded, Canceled, Failed, New, Pending, Provisioning, PendingBilling, ConfirmedBilling, Creating, Created, Expired)
roleDefinitionIdstringThe ID of the role definition. Required.
scopestringThe scope at which the role was assigned.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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 < > % & \ ? /.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
userAuthenticationTypestringThe authentication type of the user, whether Organization or MSA, of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement.
userEmailAddressstringThe email address of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_customerselectbilling_account_name, billing_profile_name, customer_name, billing_role_assignment_nameGets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
get_by_invoice_sectionselectbilling_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_nameGets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
list_by_customerselectbilling_account_name, billing_profile_name, customer_namefilter, top, skipLists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
list_by_invoice_sectionselectbilling_account_name, billing_profile_name, invoice_section_namefilter, top, skipLists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
get_by_billing_profileselectbilling_account_name, billing_profile_name, billing_role_assignment_nameGets 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.
get_by_departmentselectbilling_account_name, department_name, billing_role_assignment_nameGets 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_accountselectbilling_account_name, enrollment_account_name, billing_role_assignment_nameGets 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_profileselectbilling_account_name, billing_profile_namefilter, 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.
list_by_departmentselectbilling_account_name, department_nameLists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement.
list_by_enrollment_accountselectbilling_account_name, enrollment_account_nameLists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement.
get_by_billing_accountselectbilling_account_name, billing_role_assignment_nameGets 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_billing_accountselectbilling_account_namefilter, 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_customerinsertbilling_account_name, billing_profile_name, customer_name, roleDefinitionIdAdds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
create_by_invoice_sectioninsertbilling_account_name, billing_profile_name, invoice_section_name, roleDefinitionIdAdds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
create_or_update_by_departmentinsertbilling_account_name, department_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
create_or_update_by_enrollment_accountinsertbilling_account_name, enrollment_account_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
create_by_billing_profileinsertbilling_account_name, billing_profile_name, 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_or_update_by_billing_accountinsertbilling_account_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
create_by_billing_accountinsertbilling_account_name, 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.
create_or_update_by_departmentreplacebilling_account_name, department_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
create_or_update_by_enrollment_accountreplacebilling_account_name, enrollment_account_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
create_or_update_by_billing_accountreplacebilling_account_name, billing_role_assignment_nameCreate or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
delete_by_customerdeletebilling_account_name, billing_profile_name, customer_name, billing_role_assignment_nameDeletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
delete_by_invoice_sectiondeletebilling_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_nameDeletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
delete_by_billing_profiledeletebilling_account_name, billing_profile_name, billing_role_assignment_nameDeletes 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_departmentdeletebilling_account_name, department_name, billing_role_assignment_nameDeletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
delete_by_enrollment_accountdeletebilling_account_name, enrollment_account_name, billing_role_assignment_nameDeletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
delete_by_billing_accountdeletebilling_account_name, billing_role_assignment_nameDeletes 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_billing_accountexecbilling_account_nameresolveScopeDisplayNames, 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.
resolve_by_billing_profileexecbilling_account_name, billing_profile_nameresolveScopeDisplayNames, 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_customerexecbilling_account_name, billing_profile_name, customer_nameresolveScopeDisplayNames, 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_sectionexecbilling_account_name, billing_profile_name, invoice_section_nameresolveScopeDisplayNames, 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.

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
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
billing_profile_namestringThe ID that uniquely identifies a billing profile. Required.
billing_role_assignment_namestringThe ID that uniquely identifies a role assignment. Required.
customer_namestringThe ID that uniquely identifies a customer. Required.
department_namestringThe name of the department. Required.
enrollment_account_namestringThe name of the enrollment account. Required.
invoice_section_namestringThe ID that uniquely identifies an invoice section. Required.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.
resolveScopeDisplayNamesbooleanResolves the scope display name for each of the role assignments. Default value is False.
skipintegerThe skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. Default value is None.
topintegerThe 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. Default value is None.

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
id,
name,
billingAccountDisplayName,
billingAccountId,
billingProfileDisplayName,
billingProfileId,
billingRequestId,
createdByPrincipalId,
createdByPrincipalPuid,
createdByPrincipalTenantId,
createdByUserEmailAddress,
createdOn,
customerDisplayName,
customerId,
invoiceSectionDisplayName,
invoiceSectionId,
modifiedByPrincipalId,
modifiedByPrincipalPuid,
modifiedByPrincipalTenantId,
modifiedByUserEmailAddress,
modifiedOn,
principalDisplayName,
principalId,
principalPuid,
principalTenantId,
principalTenantName,
principalType,
provisioningState,
roleDefinitionId,
scope,
systemData,
tags,
type,
userAuthenticationType,
userEmailAddress
FROM azure.billing.billing_role_assignments
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND customer_name = '{{ customer_name }}' -- required
AND billing_role_assignment_name = '{{ billing_role_assignment_name }}' -- 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.billing_role_assignments (
principalPuid,
principalId,
principalTenantId,
roleDefinitionId,
scope,
userAuthenticationType,
userEmailAddress,
billing_account_name,
billing_profile_name,
customer_name
)
SELECT
'{{ principalPuid }}',
'{{ principalId }}',
'{{ principalTenantId }}',
'{{ roleDefinitionId }}' /* required */,
'{{ scope }}',
'{{ userAuthenticationType }}',
'{{ userEmailAddress }}',
'{{ billing_account_name }}',
'{{ billing_profile_name }}',
'{{ customer_name }}'
RETURNING
id,
name,
properties,
systemData,
tags,
type
;

REPLACE examples

Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement.

REPLACE azure.billing.billing_role_assignments
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND department_name = '{{ department_name }}' --required
AND billing_role_assignment_name = '{{ billing_role_assignment_name }}' --required
RETURNING
id,
name,
properties,
systemData,
tags,
type;

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.billing_role_assignments
WHERE billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND customer_name = '{{ customer_name }}' --required
AND billing_role_assignment_name = '{{ billing_role_assignment_name }}' --required
;

Lifecycle Methods

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

EXEC azure.billing.billing_role_assignments.resolve_by_billing_account 
@billing_account_name='{{ billing_account_name }}' --required,
@resolveScopeDisplayNames={{ resolveScopeDisplayNames }},
@filter='{{ filter }}'
;