Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get subscription offer id from cli #11369

Closed
jackchenwork opened this issue Nov 23, 2019 — with docs.microsoft.com · 8 comments
Closed

get subscription offer id from cli #11369

jackchenwork opened this issue Nov 23, 2019 — with docs.microsoft.com · 8 comments
Assignees
Labels
Account az login/account Billing az billing Service Attention This issue is responsible by Azure service team.
Milestone

Comments

Copy link

We have lots of subscriptions with different offer ID ( enterprise or dev/test MS-AZR-0148P or others ).

It would be nice if we can get the offer id for each subscription from "az account list" result.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@fengzhou-msft fengzhou-msft added the Account az login/account label Nov 24, 2019
@fengzhou-msft
Copy link
Member

@jiasli pleaase take a look.

@jiasli
Copy link
Member

jiasli commented Nov 25, 2019

CLI uses Subscriptions - Get REST API to retrieve subscription details. This API doesn't have information about offer ID. Azure Portal fetches offer ID from https://s2.billing.ext.azure.com/api/Billing/Subscription/Subscription?api-version=2019-01-14.

@achandmsft, do you think this is a feature we need to implement with billing team?

@yonzhan yonzhan added this to the S163 milestone Dec 1, 2019
@jonotto
Copy link

jonotto commented Dec 6, 2019

Here's a real-world scenario where "something" would be useful ... Global Administrators (and others with permissions at Tenant Root) can view all subscriptions associated with the AAD tenant. In a scenario where we want to programmatically detect the creation of non-EA subscriptions or simply to run a query against these subscriptions, we currently have no means of doing so via CLI (without querying the REST API ... thanks for adding that). I'd rather stick to using a single toolset, if possible, though.

@jackchenwork
Copy link
Author

A user with enough permission on subscriptions level can see the subscriptions offer ID from Azure portal. On the other hand, most user don't have permission to access the billing API.

@yonzhan yonzhan modified the milestones: S163, S164 Dec 30, 2019
@yonzhan yonzhan modified the milestones: S164, S165 Feb 1, 2020
@yonzhan yonzhan modified the milestones: S165, S167 Feb 15, 2020
@jiasli jiasli added Billing az billing Service Attention This issue is responsible by Azure service team. labels Feb 19, 2020
@jiasli jiasli modified the milestones: S167, Backlog Feb 19, 2020
@paulanguiano
Copy link

We fall back on Azure Resource Graph to make up for many of these shortcomings:

az graph query -q 'resourcecontainers | where type == "microsoft.resources/subscriptions" | where properties.state != "Disabled" | project subscriptionId, name, properties.subscriptionPolicies.quotaId'

The so-called quotaId isn't the same text as the OfferID, but can be mapped directly to it.

@amberbhargava
Copy link
Member

As mentioned above, offer ID is a billing construct so it is not available through the Subscription - Get API. The API does have quota ID, which can be used to differentiate subscriptions of different types (Ex: Microsoft Azure Enterprise, Pay as you go, etc.).

@AlexandreArpin
Copy link
Contributor

The so-called quotaId isn't the same text as the OfferID, but can be mapped directly to it.

That is not always the case when considering older subscriptions and multiple tenants in multiple countries.

As mentioned above, offer ID is a billing construct so it is not available through the Subscription - Get API

@amberbhargava 100%, it is required by some of the Pricesheet API, which are still required until Microsoft.Consumption and Microsoft.CostManagement providers fully supported all usage scenarios.

There's currently no workaround when managing multiple enrollements and subscriptions (100+) or when leveraging the partner ecosystem (3rd Party Solution to read/analyze costs, where manually mapping the OfferId is not possible).

The feature request on UserVoice is among the most popular, It would be incredibly useful for the bigger organisation and the partner ecosystem to have something along the lines of https://s2.billing.ext.azure.com/api/Billing/Subscription/Subscription?api-version=2019-01-14 available through a REST Api.

@jikuja
Copy link

jikuja commented Apr 23, 2024

The API does have quota ID, which can be used to differentiate subscriptions of different types (Ex: Microsoft Azure Enterprise, Pay as you go, etc.).

Where is mapping from quotaId to offerId?

The feature request on UserVoice is among the most popular, It would be incredibly useful for the bigger organisation and the partner ecosystem to have something along the lines

Anyone has a new link for this? Looks like google does not find it anymore. (That's one way to solve feedback items.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account Billing az billing Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

9 participants