We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://learn.microsoft.com/en-us/rest/api/billing/invoices/list-by-billing-profile?view=rest-billing-2020-05-01&tabs=Python
azure.mgmt.billing 6.0.0
I run this code:
from azure.mgmt.billing import BillingManagementClient from azure.identity import ClientSecretCredential credentials = ClientSecretCredential( tenant_id="<TenantID>", client_id="<ClientID>", client_secret="<ClientSecret>", api_version="2020-05-01" ) client = BillingManagementClient( credential=credentials, subscription_id='<SubscriptionID>', ) response = client.invoices.list_by_billing_profile( billing_account_name="<BillingAccount>", billing_profile_name="<BillingProfile>", period_start_date="2024-02-01", period_end_date="2024-02-29", ) for item in response: print(item)
I don't get an invoice in return.
An invoice description in JSON format.
The sample code give me this output:
{'additional_properties': {}, 'id': '/providers/Microsoft.Billing/billingAccounts/<BillingAccount>/invoices/<Invoice>', 'name': 'G040589327', 'type': 'Microsoft.Billing/billingAccounts/invoices', 'due_date': datetime.datetime(2024, 4, 4, 6, 7, 13, 95965, tzinfo=<isodate.tzinfo.Utc object at 0x000002FE9EEEB050>), 'invoice_date': datetime.datetime(2024, 3, 5, 6, 7, 13, 95965, tzinfo=<isodate.tzinfo.Utc object at 0x000002FE9EEEB050>), 'status': 'Due', 'amount_due': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE779D0>, 'azure_prepayment_applied': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77A50>, 'billed_amount': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77E50>, 'credit_amount': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77E90>, 'free_azure_credit_applied': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77AD0>, 'sub_total': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77ED0>, 'tax_amount': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77F90>, 'total_amount': <azure.mgmt.billing.models._models_py3.Amount object at 0x000002FE9FE77F50>, 'invoice_period_start_date': datetime.datetime(2024, 2, 1, 0, 0, tzinfo=<isodate.tzinfo.Utc object at 0x000002FE9EEEB050>), 'invoice_period_end_date': datetime.datetime(2024, 2, 29, 23, 59, 59, 999999, tzinfo=<isodate.tzinfo.Utc object at 0x000002FE9EEEB050>), 'invoice_type': None, 'is_monthly_invoice': True, 'billing_profile_id': '/providers/Microsoft.Billing/billingAccounts/<BillingAccount>/billingProfiles/<BillingProfile>', 'billing_profile_display_name': 'Formpipe Software Ltd', 'purchase_order_number': '', 'documents': [<azure.mgmt.billing.models._models_py3.Document object at 0x000002FEA11940D0> ], 'payments': [], 'rebill_details': None, 'document_type': 'Invoice', 'billed_document_id': None, 'credit_for_document_id': None, 'subscription_id': None }
If I change to
for item in response: print(item.serialize())
I get this output: {}
{}
Run the example.
Windows 11 Python 3.11.2
The text was updated successfully, but these errors were encountered:
Hi @tomasrudh Please try:
for item in response: print(item.serialize(keep_readonly=True))
Sorry, something went wrong.
msyyc
No branches or pull requests
Link to sample
https://learn.microsoft.com/en-us/rest/api/billing/invoices/list-by-billing-profile?view=rest-billing-2020-05-01&tabs=Python
Library name and version
azure.mgmt.billing 6.0.0
Language of the Sample
Sample Issue Type
Issue details
I run this code:
I don't get an invoice in return.
Expected behavior
An invoice description in JSON format.
Actual behavior
The sample code give me this output:
If I change to
I get this output:
{}
Reproduction Steps
Run the example.
Environment
Windows 11
Python 3.11.2
The text was updated successfully, but these errors were encountered: