0

I'm facing an issue while trying to retrieve transactions using Microsoft.Azure.Management.Billing for a particular account. This account has multiple subscriptions attached to it. On the other hand, I also have another account under the 'Microsoft Customer Agreement,' but with a different account ID format: 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx_2019-05-31.' Interestingly, I can successfully retrieve transaction data for the second account using the provided code.

Here's the code snippet I'm using:

var billingClient = new BillingManagementClient(serviceCreds);
billingClient.SubscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
var invoice = billingClient.Invoices.GetById("E0500O0000");

However, whenever I call the following code to retrieve transactions for the first account, it doesn't return any data:

var content = billingClient.Transactions.ListByInvoice(billingAccountName: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", invoice.Name);

I'm not sure if this issue is related to the account type. The account type for the first account is 'Microsoft Online Services Program,' and its account ID is in GUID format. Could someone please assist me in resolving this?

Lakmal
  • 779
  • 1
  • 8
  • 16

0 Answers0