Role Assignments - Put

Create or update a billing role assignment.

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}?api-version=2019-10-01-preview

URI Parameters

Name In Required Type Description
billingAccountName
path True

string

The ID that uniquely identifies a billing account.

billingRoleAssignmentName
path True

string

The ID that uniquely identifies a role assignment.

api-version
query True

string

The version of the API to be used with the client request. The current version is 2019-10-01-preview.

Request Body

Name Type Description
properties.principalId

string

The principal id of the user to whom the role was assigned.

properties.principalTenantId

string

The principal tenant id of the user to whom the role was assigned.

properties.roleDefinitionId

string

The ID of the role definition.

properties.userAuthenticationType

string

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

properties.userEmailAddress

string

The email address of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement.

Responses

Name Type Description
200 OK

BillingRoleAssignment

OK. The request has succeeded.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

PutEnrollmentAdministratorRoleAssignment

Sample request

PUT https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}?api-version=2019-10-01-preview

{
  "properties": {
    "principalId": "99a1a759-30dd-42c2-828c-db398826bb67",
    "principalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f",
    "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"
  }
}

Sample response

{
  "id": "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402",
  "name": "9dfd08c2-62a3-4d47-85bd-1cdba1408402",
  "properties": {
    "createdOn": "2019-06-28T19:11:50.6168809+00:00",
    "createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f",
    "createdByPrincipalId": "60d97094-2be4-46cc-a4fe-3633021a25b9",
    "principalId": "99a1a759-30dd-42c2-828c-db398826bb67",
    "principalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f",
    "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db",
    "scope": "/providers/Microsoft.Billing/billingAccounts/7898901"
  },
  "type": "Microsoft.Billing/billingAccounts/billingRoleAssignments"
}

Definitions

Name Description
BillingRoleAssignment

The role assignment

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

ErrorSubDetails

BillingRoleAssignment

The role assignment

Name Type Description
id

string

Resource Id.

name

string

Resource name.

properties.createdByPrincipalId

string

The principal Id of the user who created the role assignment.

properties.createdByPrincipalTenantId

string

The tenant Id of the user who created the role assignment.

properties.createdByUserEmailAddress

string

The email address of the user who created the role assignment. This is supported only for billing accounts with agreement type Enterprise Agreement.

properties.createdOn

string

The date the role assignment was created.

properties.name

string

The name of the role assignment.

properties.principalId

string

The principal id of the user to whom the role was assigned.

properties.principalTenantId

string

The principal tenant id of the user to whom the role was assigned.

properties.roleDefinitionId

string

The ID of the role definition.

properties.scope

string

The scope at which the role was assigned.

properties.userAuthenticationType

string

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

properties.userEmailAddress

string

The email address of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement.

type

string

Resource type.

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

details

ErrorSubDetails[]

The sub details of the error.

message

string

Error message indicating why the operation failed.

target

string

The target of the particular error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Name Type Description
error

ErrorDetails

The details of the error.

ErrorSubDetails

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

target

string

The target of the particular error.