Share via

Create cost export path using rest api

Padmanabhan M 220 Reputation points
2026-02-02T10:58:31.3666667+00:00

I am using a partner network and i want to create a cost export path for my subscription using the rest api .
I referred this documentation and used this url.
"https://learn.microsoft.com/en-us/rest/api/cost-management/exports/create-or-update?view=rest-cost-management-2025-03-01&tabs=HTTP#exportcreateorupdatebysubscription"

I got this error

{
    "error": {
        "code": "BadRequest",
        "message": "Request properties validation failed: Export type: ActualCost is not supported for Agreement Type: WebDirect and Subscription."
    }
}
Cost Management
Cost Management

A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.


Answer accepted by question author

Siva shunmugam Nadessin 10,810 Reputation points Microsoft External Staff Moderator
2026-02-02T12:12:30.4166667+00:00

Hello Padmanabhan M,

To resolve this, follow these steps:

Grant the necessary permissions to the Storage Account in Subscription B:

Assign the Storage Account Contributor role to the user/service principal (the identity performing the export) at the Storage Account level in Subscription B. This role provides the necessary permissions to the export process to create the cost export in the destination storage account.

Verify Role Assignments:

·         Ensure that the user/service principal performing the cost export in Subscription A has the Cost Management Contributor role.

·         In Subscription B, assign the Storage Account Contributor role at the storage account level for the user/service principal performing the export operation.

Steps to Grant Permissions:

·         Assign Storage Account Contributor Role in Subscription B:

·         Navigate to Subscription B > Storage Account.

·         In the IAM (Identity and Access Management) section, add the Storage Account Contributor role to the user/service principal performing the operation.

Assign Cost Management Contributor Role in Subscription A:

If you haven't already, ensure the Cost Management Contributor role is assigned to the appropriate identity on Subscription A.

Verify Cross-Subscription Access:

Cross-subscription role assignments are sometimes tricky. Double-check the effective permissions using the Access Control (IAM) section in both subscriptions to ensure that the roles have been assigned properly.

Testing and Retry:

After updating the permissions, retry the cost export operation. The export process should now have the necessary permissions to write to the storage account in Subscription B.

Conclusion:

To fix the issue, the user/service principal executing the export in Subscription A needs to have the Storage Account Contributor role on the storage account in Subscription B. Additionally, ensure that the Cost Management Contributor role is properly assigned to the identity in Subscription A. After these adjustments, the export should proceed without the RBACAccessDenied error.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-02-02T10:58:47.8466667+00:00

    The error message you received indicates that the export type ActualCost is not supported for your Agreement Type, which is WebDirect and Subscription. To resolve this issue, you should check the supported export types for your specific agreement type.

    For example, the available export types may vary based on the type of agreement you have (like Enterprise Agreement, Microsoft Customer Agreement, etc.). You may need to use a different export type that is compatible with your agreement.

    To create a cost export path using the REST API, ensure that you are selecting an export type that is valid for your agreement type. You can refer to the documentation for more details on the supported export types for different agreement types.

    Additionally, if you are using a management group scope, be aware that certain datasets may not be supported, and you should ensure that your export configurations align with the requirements outlined in the Azure Cost Management documentation.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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