Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.72k stars 978 forks source link

Deploy a default budget on all subscriptions under the assigned scope fails when setting an Action group parameter #1626

Closed gerrynicol closed 6 months ago

gerrynicol commented 6 months ago

What happened? Provide a clear and concise description of the bug, including deployment details.

This custom policy deploys ok when an action group isnt set. When an action group is set in the parameters at time of assignment it fails.

Please provide the correlation id associated with your error or bug.

Resource /subscriptions/xxxxxx/providers/Microsoft.Consumption/budgets/budget-set-by-policy Operation name Create and update budgets Time stamp Wed Apr 24 2024 10:24:23 GMT+0100 (British Summer Time) Event initiated by 6223b87e-5c7e-4767-bf85-f2fbcfaa95f1 Error code 400 Message Bad Request. Request ID: b082aee9-fc42-45f3-9a33-0e0fb4870334

What was the expected outcome?

The Action group should eithe rbe cerated or use an existing Action group tha has already been created in the Subscription and can be referenced by name

Relevant log output

No response

Check previous GitHub issues

Code of Conduct

jtracey93 commented 6 months ago

Thanks for reporting. Moving this the Enterprise Scale repo as this is the source of truth for our policies and needs fixing there first and it'll roll down to Bicep & TF 👍

tagging @springstone also

Springstone commented 6 months ago

@gerrynicol Took me a bit of time to figure out what is going on here. I think the issue may be related how you are assigning the policy. You are correct, we do not deploy an action group as part of the budget policy, so the action group must exist in order to use it with this policy. Also, if you just provide the action group name, you will get that error (400 Bad Request), you need to provide the full resource ID of the action group like: /subscriptions/mysubscriptionID/resourceGroups/myresourcegroup/providers/microsoft.insights/actiongroups/AGTest

Could you please try again with the full resource ID of the action group?

gerrynicol commented 6 months ago

@Springstone. Nice one. Thanks for looking at that so quickly. Yip, that works a treat :)