Platform

 View Only

 GET Azure Billing Data into CT via REST Service API

Jump to  Best Answer
  • Datalink
Apptio Community Member's profile image
Apptio Community Member posted Wed May 11, 2022 04:21 AM
Hi,

a customer of us cannot use the Multicloud Connector to connect to azure, as he has no permissions on enterprise level and the connector requires EA Access.
We would now like to get the relevant azure Data into Cost Transparency by using the generic REST Service of Datalink.

Has anyone ever done this and can help us out with this? There are a few questions we were not able to answer yet:

  • Content
    • Which Azure Reports would need to be exported? We need only general billing data (Account ID, Products, Quantities, Cost/Prices)
    • Our Idea was using the Usage Details: https://docs.microsoft.com/en-us/rest/api/consumption/usage-details/list 
  •  Connector-Settings
    • Which would be the "REST URL" to be entered in the DataLink Connector?
    • Authentucation URL?: https://login.microsoftonline.com/common/oauth2/authorize
    • Token URL?: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
    • Resource Path URL: Would it then be "https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2021-10-01", if we would use the Usage Details Report?
    • Rest Headers: No Idea

Unfortunately our customer did not seem to know too much about the azure side with regards to REST APIs  and we do not have a lot of experience with the REST Service Connector. I hope someone can help me.

Best Regards
Kevin

#Datalink
Debbie Hagen's profile image
Debbie Hagen  Best Answer

Hi @Kevin Sylvester,
I think that creating a support ticket is a good next step.  If you get a solution would you mind posting it here so we can all learn.

I don't know of anyone who has included Azure data with a generic connector but I will post the question on a relevant internal channel and see if anyone else has heard of it. If  they have I'll either post back here or have them do so.

Cheers,

Deb​


#Datalink
Apptio Community Member's profile image
Apptio Community Member
@Jaitabh Jewel Sharma I see you had a request about this topic, too - were you able to retrieve the data? Can you help me out?
Thanks and best regards
Kevin​
#Datalink
Guillermo Cuadrado's profile image
Guillermo Cuadrado
I am not sure about the REST connector approach: in any case, to get oauth2 to work, you'd need credentials. If your client's Azure administrator doesn't grant them EA access, would they set up a similar thing for REST?
If the report you're trying to download is associated to a Subscription, you might not get all the relevant data. Somebody who knows more about Azure, please correct me if I'm wrong.
Furthermore, there's a lot of logic inside CT to map the Azure billing data. Some other things might not work, although you might work around this particular issue.
 
On a more positive note:
In trying to use the REST connector—albeit for something slightly different—we tried with Postman, to ensure a better troubleshooting while things weren't working. Apptio Support also supported this. If you can get to your data via Postman, you should be able to get the REST connector to work.
#Datalink
Debbie Hagen's profile image
Debbie Hagen

Hi @Kevin Sylvester,
Just checking in to see if you found a resolution for this. If not let me know and we'll continue to change down an answer.  You could also try submitting a support ticket. I don't think anything is broken but Support may be able to help with your question and show you possible options.

Cheers,

Deb​


#Datalink
Apptio Community Member's profile image
Apptio Community Member
@Guillermo Cuadrado Thank you for your answer.
According to the customer they would not need EA Access for the reports we want to you - they say they can handle it on tenant level. At least it is what they think. The reports that we have been looking at seem to work with their level of access. ("Usage Details")
We know that Apptio CT applies some logic automatically​ to the Azure billing data. For their current use case, they would not need this as they currently only use Apptio as a platform to serve their specific needs and do not use the whole TBM approach by now.

@Debbie Hagen Thank you, too!
Unfortunately we do not have a solution yet. I will open a support ticket to see if they have any idea about this.​
If you would know anyone who might have icluded Azure data via a generic connector, it would be great to make contact.​

Main issue for us currently is to get the basic settings for the rest connector right... we are not sure about REST URL, auth URL and Token URL.
#Datalink
Jaitabh Jewel Sharma's profile image
Jaitabh Jewel Sharma
@Kevin Sylvester ... sorry I just saw this.

We haven't used the generic REST Connector with Azure, but we use it for several other data feeds (ServiceNow being one such) ... and setting it up is not too tedious. However, the Apptio DL User needs EA Access and the API credentials for the same, else it wouldn't work.​

As @Guillermo Cuadrado mentioned, you need to sort the authorization first. Once that is established, you can use a tool like Postman to iterate to the data feed you want to extract.

Also, MultiCloud connector pulls data from the Old Billing API
https://docs.microsoft.com/en-us/rest/api/billing/enterprise/billing-enterprise-api-usage-detail

but you've already mentioned the latest Consumption API above, so definitely use that one. It includes many more useful columns such as Billing Account ID. ​​
#Datalink