[Feature]: Add support for listing customers under a billing account
Description of the new feature
First, a little backstory. I'm looking for a way to automatically create subscriptions for our customers. We have a MicrosoftPartnerAgreement billing account where our customers are located. To be able to create new subscriptions for a specific customer within the billing account I need to know the scope which consist of billing account name and the customer id. Here's the problem: I cannot find a way to list all customers within a billing account using the Az.Billing powershell module.
There is a parameter on the Get-AzBillingAccount cmdlet named -ListEntitiesToCreateSubscription, which will list customers, but not their ID so it cannot be used to create subscriptions.
I'm proposing to implement a cmdlet similar to this Azure CLI command which will list customers within that billing account and the output includes the full scope:
az billing customer list --account-name "abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Which will give this output, and its the id property I'm after.
[
{
"billingProfileDisplayName": "Contoso Billing Profile",
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/billingProfiles/4788d852-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"displayName": "Customer One",
"enabledAzurePlans": null,
"id": "/providers/Microsoft.Billing/billingAccounts/abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/customers/6gd5f06e-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "6gd5f06e-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"resellers": null,
"type": "Microsoft.Billing/billingAccounts/customers"
}
]
Proposed implementation details (optional)
No response
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cabbpt.
Issue Details
Description of the new feature
First, a little backstory. I'm looking for a way to automatically create subscriptions for our customers. We have a MicrosoftPartnerAgreement billing account where our customers are located. To be able to create new subscriptions for a specific customer within the billing account I need to know the scope which consist of billing account name and the customer id. Here's the problem: I cannot find a way to list all customers within a billing account using the Az.Billing powershell module.
There is a parameter on the Get-AzBillingAccount cmdlet named -ListEntitiesToCreateSubscription, which will list customers, but not their ID so it cannot be used to create subscriptions.
I'm proposing to implement a cmdlet similar to this Azure CLI command which will list customers within that billing account and the output includes the full scope:
az billing customer list --account-name "abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Which will give this output, and its the id property I'm after.
[
{
"billingProfileDisplayName": "Contoso Billing Profile",
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/billingProfiles/4788d852-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"displayName": "Customer One",
"enabledAzurePlans": null,
"id": "/providers/Microsoft.Billing/billingAccounts/abcd1234-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/customers/6gd5f06e-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "6gd5f06e-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"resellers": null,
"type": "Microsoft.Billing/billingAccounts/customers"
}
]
Proposed implementation details (optional)
No response
| Author: | madsaune |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
Hi Mads,
Thank you reaching out.
The cmdlet for listing customers for a billing account is not yet available. We have it in our backlog but don't have a concrete ETA yet.
Meanwhile, you can use either the REST API (https://docs.microsoft.com/en-us/rest/api/billing/2020-05-01/customers/list-by-billing-account) or CLI command for now.