none
Azure Policy for Resource Group Budgets RRS feed

  • Question

  • Hi,

    I am looking at setting up budgets for all of my Resource Groups within my subscription and would like to make sure that all new Resource Groups will require a budget upon creation. Is there a policy that can be applied to ensure that a Resource Group needs a budget attached in order to be created, or a way of tracking what Resource Groups do not have a active budget? What is the best method of ensure that a active budget is applied to each Resource Group? 

    Any suggestions would be greatly appreciated.

    Thanks  


    Tuesday, October 15, 2019 6:54 AM

All replies

  • This is really an interesting scenario.
    However, I checked the JSON template of an RG with a budget attached to it, and there is no cost-management objects/properties listed.

    Also, when you create an RG (in the portal for example), there is no “inline” option to create a budget as part of the RG creation process. Therefore, even if you could create a Policy for it, it would prevent the creation of all RGs, since it’s not an inline (but a post) action.

    The only way I can think of checking, would be a PowerShell script (or Resource Graph query) to obtain the list of Resource Group names, and then run a loop against the Microsoft.Consumption/budgets resource type, checking the ‘filters’ ‘resourceGroups’ property.


    Wednesday, October 16, 2019 9:36 AM
    Moderator