Proper way to retrieve Offer Type of Subscriptions via REST API

Raymond Sarmiento 1 Reputation point
2022-07-08T05:38:00.803+00:00

I am trying to retrieve the offer type of azure subscriptions via REST API. Currently, I am having problem identifying a Microsoft Customer Agreement type from an Enterprise Agreement type. I needed to add an extra cost management-related role to a user when the type is of Microsoft Customer Agreement.

The existing endpoint for subscriptions using Azure Resource Management API has no property relating to its offer type aside from subscriptionPolicies.quotaId which is the same for both. Doing it via Azure Resource Graph API yields the same result.

Is there a way I can identify each of the subscriptions' offer type? Preferably via REST.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
1,853 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 9,836 Reputation points
    2022-07-13T20:36:59.957+00:00

    Hello @Raymond Sarmiento - Welcome to Microsoft Q&A and thanks for reaching out to us.

    Apologies for the delay in responding back to you.

    There is a way to get offer Type using Azure REST API.

    Endpoint: GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2019-10-01

    You can run\try by hitting below url: https://learn.microsoft.com/en-us/rest/api/consumption/usagedetails/list#code-try-0

    You need to login with your Azure user id and password to try\test it.

    220572-image.png

    You will get response as shown below with offer id:

    220527-image.png

    For more detail, please refer Usage Details - List API: https://learn.microsoft.com/en-us/rest/api/consumption/usagedetails/list.

    Hope this helps. and please feel free to reach out if you have any further questions.

    ------------------------------------------------------------------

    If the above response was helpful, please feel free to "Accept as Answer" and "Upvote" the same so it can be beneficial to the community.

    0 comments No comments