Azure-docs: AzureRM - Subscriptions API

Created on 20 Jan 2020  路  14Comments  路  Source: MicrosoftDocs/azure-docs

I did not find a github page for anything under this or this, hence I am opening a generic issue. If you find the relevant Github docs, please do link them to this issue.


When you list (or get a single subscription) using one of:

https://management.azure.com/subscriptions

or

https://management.azure.com/subscriptions/{subscriptionId}

You get the subscriptionPolicies > spendingLimit. The value is currently one of: On, Off or CurrentPeriodOff

Now, my question is, how do you get details of the spending limit? For example, if I am managing a customer's subscription and the subscription has this flag set, how would my app know what the spending limit is?

I have tried looking through the Billing API docs, but except for this, nothing else returns any reasonable results.

Pri3 billinsvc cxp product-question triaged

All 14 comments

Hello @sujayvsarma ,

Thank you for your feedback! We will review and provide an update as appropriate.

I have one more question -- this is regarding the Subscriptions List/Get API.

What Azure AD roles are required to return a list of subscriptions?

I have two users added to an Azure AD. Both are assigned ONLY the "Global Administrator" role. User1 was the user that was used to provision the subscription & tenant. User2 was created manually -- using the Azure Portal -- and then assigned the Global Administrator role.

When I use User1 to retrieve the list of subscriptions (via AzureRM API), I get the right results. But, when I use User2, I get a blank list -- the values[] array node in the result Json is empty. This happens when I use the Try it feature on the DOCS site also -- so it is not a problem in _my_ code. I have tried to compare the two Jwt tokens on jwt.ms, but I am not able to discern any visible difference between the two.

This particular problem is solved. Apparently I had forgotten to grant User2 access to the subscriptions (was only admin of the tenant & not of the subscription as well).

Do find me answers to the original question.

@sujayvsarma Thanks for the update. Glad to know you were able to fix this issue.

Closing this issue as no further action required. Feel free to get back to us if you've any questions in this matter.

@SadiqhAhmed-MSFT - who said my question is resolved? please read my last comment correctly.

reopen!!!

Is there an ETA on the answer please?

@amberbhargava Can you please review and comment?

The active question is what's in my original post at the top of the thread

@amberbhargava To share insights.

If there is no such API or you dont know of one, do let me know so that I can find other ways to do this. It does not really help to keep this ticket in limbo for so long. :)

Running the portal with F12 (Developer Tools) open, told me the following:

But the regular Bearer token does not work with this API. There is something else going on behind the scenes which is not visible with an F12 view.

So question is, will there be an Azure API wrapper for whatever https://s2.billing.ext.azure.com/api/Billing/RemainingCredits returns so that it can be called from Azure API consuming applications ?

There SHOULD be a way for this, because there are services like Cloudyn [though that is Microsoft-owned] that are able to pull this data and use it.

Still waiting for a response.

@sujayvsarma - Apologies for the delay. Currently the spending limit details can't be retrieved through any APIs.

feedback #azurecxp

Issue handling feedback: The team took an inordinately long time [15 days!] to respond to this question.

Was this page helpful?
0 / 5 - 0 ratings