AzureBillingAccountsRoleAssignment¶
Parameters¶
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| PrincipalName | Key | String | Name of the principal associated to the role assignment. | |
| RoleDefinition | Key | String | Name of the role assigned to the principal. | |
| PrincipalType | Write | String | Principal type. Can be User, Group or ServicePrincipal. | |
| BillingAccount | Write | String | Name of the billing account. | |
| PrincipalTenantId | Write | String | The principal tenant id of the user to whom the role was assigned. | |
| Ensure | Write | String | Present ensures the instance exists, absent ensures it is removed. | Absent, Present |
| SubscriptionId | Write | String | The Azure subscription to connect to if the access is restricted on subscription level. | |
| Credential | Write | PSCredential | Credentials of the workload's Admin | |
| ApplicationId | Write | String | Id of the Azure Active Directory application to authenticate with. | |
| TenantId | Write | String | Id of the Azure Active Directory tenant used for authentication. | |
| CertificateThumbprint | Write | String | Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication. | |
| CertificatePassword | Write | PSCredential | Username can be made up to anything but password will be used for CertificatePassword | |
| CertificatePath | Write | String | Path to certificate used in service principal usually a PFX file. | |
| ManagedIdentity | Write | Boolean | Managed ID being used for authentication. | |
| AccessTokens | Write | String[] | Access token used for authentication. |
Description¶
Manages roles on billing accounts.
Permissions¶
Azure Service Management¶
To authenticate with the Azure Service Management API, this resource requires the following permissions:
Delegated permissions¶
- Read
-
user_impersonation
-
Update
- user_impersonation
Application permissions¶
- Read
-
None
-
Update
- None
Examples¶
Example 1¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
AzureBillingAccountsRoleAssignment "AzureBillingAccountsRoleAssignment-Example"
{
BillingAccount = "Contoso Billing Account";
Ensure = "Present";
PrincipalName = "John.Smith@$TenantId";
PrincipalType = "User";
PrincipalTenantId = "9c888910-6b3b-4c17-8cff-844fefb026d4";
RoleDefinition = "Billing account owner";
SubscriptionId = "<subscription-id>";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}
Example 2¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
AzureBillingAccountsRoleAssignment "AzureBillingAccountsRoleAssignment-Example"
{
BillingAccount = "Contoso Billing Account";
Ensure = "Present";
PrincipalName = "John.Smith@$TenantId";
PrincipalType = "User";
PrincipalTenantId = "1f4c7b28-59d0-4a63-9e15-3b8ad2c60f47"; # Updated Property
RoleDefinition = "Billing account owner";
SubscriptionId = "<subscription-id>";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}
Example 3¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
AzureBillingAccountsRoleAssignment "AzureBillingAccountsRoleAssignment-Example"
{
Ensure = "Absent";
PrincipalName = "John.Smith@$TenantId";
RoleDefinition = "Billing account owner";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}