If you have an environment with a lot of Azure subscriptions it can be challenging to keep on top of them. As an Admin on a management group you may see the following combinations of subscriptions:

  • Lots of MSDN / MPN subscriptions taken up where developers get $150 per month for free
  • Normal subscriptions used for your dev/test/prod workloads
  • Subscriptions given certain offers like Azure Sponsorship

Its not easy to see which subscriptions have which offers. I was trying to workout which of our subscriptions have an Azure sponsorship applied to them and if any of them have a spending cap on them.

The below resource graph query let me do this

resourcecontainers
| where type == "microsoft.resources/subscriptions"
| where properties.subscriptionPolicies.quotaId contains "Sponsored"
| extend spendingLimit = properties.subscriptionPolicies.spendingLimit
| extend quotaId = properties.subscriptionPolicies.quotaId
| extend state = properties.state
| project name, subscriptionId, state, quotaId, spendingLimit

You might also find the below query useful too if you want to check how many subscriptions you have with each type of quota

resourcecontainers
| where type == "microsoft.resources/subscriptions"
| extend quotaId = tostring(properties.subscriptionPolicies.quotaId)
| extend state = tostring(properties.state)
| summarize count() by quotaId, state

Hopefully this helps you keep an eye on your use of sponsorship subscriptions and where they are used.

 

Buy Me A Coffee