Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AttributeError: 'BillingManagementClient' object has no attribute 'format_url' #3860

Closed
dpeanalyticswipro opened this issue Nov 22, 2018 · 0 comments

Comments

@dpeanalyticswipro
Copy link

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'

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant