You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from msrest import Serializer
from msrest import Deserializer
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.billing import BillingManagementClient
from azure.mgmt.billing.billing_management_client import BillingManagementClientConfiguration
from azure.mgmt.billing.operations import BillingPeriodsOperations
TENANT_ID = 'XXXXX'
CLIENT = 'YYYY'
KEY = 'ZZZZ'
credentials = ServicePrincipalCredentials(client_id = CLIENT,secret = KEY,tenant = TENANT_ID)
subscription_id = 'abcde'
billing_client = BillingManagementClient(credentials, subscription_id)
billing_config = BillingManagementClientConfiguration(credentials, subscription_id)
serializer = Serializer()
deserializer = Deserializer()
billing_operation = BillingPeriodsOperations(billing_client, billing_config, serializer, deserializer)
for billing_period in billing_operation.list():
print billing_period.id
Executing the above throws the error:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 143, in next
self.advance_page()
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 129, in advance_page
self._response = self._get_next(self.next_link)
File "/usr/lib/python2.7/site-packages/azure/mgmt/billing/operations/invoices_operations.py", line 85, in internal_paging
url = self._client.format_url(url, **path_format_arguments)
AttributeError: 'BillingManagementClient' object has no attribute 'format_url'
The text was updated successfully, but these errors were encountered:
My Code:
from msrest import Serializer
from msrest import Deserializer
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.billing import BillingManagementClient
from azure.mgmt.billing.billing_management_client import BillingManagementClientConfiguration
from azure.mgmt.billing.operations import BillingPeriodsOperations
TENANT_ID = 'XXXXX'
CLIENT = 'YYYY'
KEY = 'ZZZZ'
credentials = ServicePrincipalCredentials(client_id = CLIENT,secret = KEY,tenant = TENANT_ID)
subscription_id = 'abcde'
billing_client = BillingManagementClient(credentials, subscription_id)
billing_config = BillingManagementClientConfiguration(credentials, subscription_id)
serializer = Serializer()
deserializer = Deserializer()
billing_operation = BillingPeriodsOperations(billing_client, billing_config, serializer, deserializer)
for billing_period in billing_operation.list():
print billing_period.id
Executing the above throws the error:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 143, in next
self.advance_page()
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 129, in advance_page
self._response = self._get_next(self.next_link)
File "/usr/lib/python2.7/site-packages/azure/mgmt/billing/operations/invoices_operations.py", line 85, in internal_paging
url = self._client.format_url(url, **path_format_arguments)
AttributeError: 'BillingManagementClient' object has no attribute 'format_url'
The text was updated successfully, but these errors were encountered: