Azure CostManagement Export Api createOrUpdate returns 401

51 Views Asked by At

I am invoking the different endpoints of the CostManagement Export API. I am successfully using the Get and Delete methods, but when I try to Create an export I get: {"error":{"code":"401","message":"Unauthorized (Request ID: 4ccbb40a-58c1-4ac6-8c1d-6a1b5c17a07c)"}}.

I am using the Java SDK. The service principle has the following roles: Reader for Billing Account, Reader, Cost Manageemnt Contributor, Storage Account Contributor, Storage Blob Data Contributor, Monitoring Contributir for Root management group.

I have also enabled user_impersonation premission for the Azure Service Management for the service principle.

Is there some additional roles or step to be made, so I can create an export trough the service principle?

I also tried calling the API trough a spring rest template and generating token with scope: "https://management.azure.com/.default", but I still get the same 401 error.

1

There are 1 best solutions below

1
Stanislav Fotev On

After connecting with microsoft support, it seems there is a gap in the functionality of the API if you want to call it for a billingAccount.