Azure CostManagement Api - GenerateDetailedCostReportOperationResult error code 500

Stanislav Fotev 100 Reputation points
2024-01-11T07:54:13.86+00:00

I am calling the Generate Detailed Cost Report - Create Operation successfully, but when I try to call the OperationResult I am getting the error below. How can I troubleshoot such an error? I am adding the Authorization header and the scope and operationId as pathParams.

{
    "error": {
        "code": "500",
        "message": "An error occurred during processing this request. Use this request id '<
Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,609 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Pinaki Ghatak 4,375 Reputation points Microsoft Employee
    2024-01-11T08:10:24.39+00:00

    Hello @Stanislav Fotev Since you have provided very limited information, and given the limited information, this is what I can help with - as a start. The error code 500 you’re encountering is an internal server error. Here are some steps you can take to troubleshoot this issue:

    1. Wait and Retry: This type of error is often temporary. Wait for about an hour and then try your request again. Let me know if this works
    2. Check API Key and Subscription ID: Ensure that you’re using the correct API key and it has the necessary permissions to access the Azure Cost Management API. Also, verify that you’re using the correct subscription ID.

    Remember, when dealing with APIs, it’s crucial to ensure that all parameters are correctly set and that you have the necessary permissions to perform the desired operations.


  2. Stanislav Fotev 100 Reputation points
    2024-01-11T08:49:54.66+00:00

    Hi @Pinaki Ghatak , I am calling successfully the following URL: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/<<id>>/providers/Microsoft.CostManagement/generateDetailedCostReport?api-version=2023-11-01 So I assume my scope is correct. From the response header of the CreateOperation call I get the following URL: Azure-Consumption-AsyncOperation: https://management.azure.com:443/providers/Microsoft.Billing/billingAccounts/<<id>>/providers/Microsoft.CostManagement/operationStatus/99b7c5ae-ed55-465c-8ffc-13263ecc22a9?api-version=2023-11-01 I call the OperationStatus operation with the returned URL from the first call and I receive the error:

    {
        "error": {
            "code": "500",
            "message": "An error occurred during processing this request. Use this request id '10ea2a64-ece0-4811-a04d-d9de8bda90cd' for follow-up."
        }
    }
    
    
    

    With this additional information could you provide me with some more assistance?


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.