azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

[Feature]: Add support for listing customers under a billing account

Open claw0ry opened this issue 4 years ago • 2 comments

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

claw0ry avatar Apr 21 '22 08:04 claw0ry

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:

feature-request, Billing, Service Attention, customer-reported

Milestone: -

ghost avatar Apr 22 '22 12:04 ghost

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.

muazmian avatar Apr 29 '22 00:04 muazmian