I am using below trying to pull azure savings plan utilization data but I am getting error
AttributeError: 'CostManagementClient' object has no attribute 'benefit_utilization_summaries'
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
from azure.identity import ClientSecretCredential
from azure.mgmt.compute import ComputeManagementClient
credential = ClientSecretCredential(
tenant_id='',
client_id= '',
client_secret= ''
)
client = CostManagementClient(
credential=credential
)
response = client.benefit_utilization_summaries.list_by_billing_account_id(
billing_account_id="",
)
for item in response:
print(item)
I am referring below azure documentation. can you guide me how what i am doing wrong and how can i fix it.
https://learn.microsoft.com/en-in/rest/api/cost-management/benefit-utilization-summaries/list-by-billing-account-id?tabs=Python#savingsplanutilizationsummaries-billingaccount