azure savings plan utillization using python

Anurag singh kuhswaha 21 Reputation points

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(  
        client_id= '',  
        client_secret= ''  
        client = CostManagementClient(  
        response = client.benefit_utilization_summaries.list_by_billing_account_id(  
        for item in response:  

I am referring below azure documentation. can you guide me how what i am doing wrong and how can i fix it.

Azure Cost Management
Azure Cost Management
An Azure service that provides cloud cost management capabilities.
981 questions
{count} votes

Accepted answer
  1. Swathi Dhanwada 9,386 Reputation points Microsoft Employee

    @Anurag singh kuhswaha azure-mgmt-costmanagement 3.0.0 doesn't have the operation benefit_utilization_summaries . This operation is recently added in the version azure-mgmt-costmanagement 4.0.0b1 which is currently in pre-release state.

    Operations within azure-mgmt-costmanagement 3.0.0


    Operations within azure-mgmt-costmanagement 4.0.0b1


    You can update the package using below command

    pip install azure-mgmt-costmanagement==4.0.0b1  
    No comments

0 additional answers

Sort by: Most helpful