Open Cost giving an error to download the price list

Kartik Hegde 0 Reputation points
2025-03-13T14:08:41.76+00:00

Issue Summary

We are experiencing an issue with OpenCost in our Azure Kubernetes Service (AKS) cluster. After enabling OpenCost using the command az aks update --resource-group <resource-group> --name <cluster-name> --enable-cost-analysis, the OpenCost pod is throwing an error related to pricing data download from the Azure API.

Error Message

The error message indicates a failure to refresh the token for the pricing data request due to multiple user-assigned identities existing in the subscription. The specific error is:

"Error in pricing download query from API...  Failed to download pricing data: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions//providers/Microsoft.Commerce/RateCard?...  StatusCode=400 -- Original Error: adal: Refresh request failed. Status Code = '400'.  Response body: {"error":"invalid_request","error_description":"Multiple user assigned identities exist, please specify the clientId / resourceId of the identity in the token request"}
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,462 questions
{count} votes

2 answers

Sort by: Most helpful
  1. LISBOA-4826 245 Reputation points Volunteer Moderator
    2025-03-16T20:43:32.8933333+00:00

    Hello Kartik Hegde

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    I understand that you are experiencing issues trying to enable the add-on on AKS for Cost Analysis.

    1-Please check and confirm that you are using the last Az cli version.

    2- Could you please try to disable and enable the add-on again?

    3-Below you can find some troubleshooting steps and documentation about this add-on:

    Also if the issues persist, please submit a support ticket - Azure create-ticket we will be more than happy to help.

    Do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you.

    Thank You.

    Lisboa

    0 comments No comments

  2. Anusree Nashetty 4,790 Reputation points Microsoft External Staff Moderator
    2025-03-18T04:40:26.3366667+00:00

    Hi Kartik Hegde,

    The error message shows that there are multiple user-assigned identities in your Azure subscription, and the system is unable to determine which identity to use for the token refresh request.

    You need to specify the clientId or resourceId of the user-assigned identity that OpenCost should use to authenticate with the Azure API.
    First, identify the user-assigned identities in your Azure subscription: az identity list --resource-group <resource-group>
    Edit the OpenCost deployment YAML file the clientId or resourceId of the identity you want to use.
    After updating the deployment YAML, apply the changes using kubectl Now restart the OpenCost pod to ensure the new configuration is picked up.

    If you have any further queries, let me know. If the solution is helpful, please click Upvote and Accept Answer for the benefit of the community.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.