I have a runbook that, since a couple of weeks, returns a 422 while getting a list of budgets in resource groups:
$budgets = Get-AzConsumptionBudget -ResourceGroupName $rg.ResourceGroupName
This returns a 422 on my test environment. On the acc and prd environment, no such error occurs. This also keeps triggering alerts in my mailbox so I want this fixed.
I ran this locally as well with fiddler, this is the raw request data:
HTTP/1.1 422 Unprocessable Entity
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 216
Content-Type: application/json; charset=utf-8
Expires: -1
session-id: 4d361bc3-d9c6-42a0-a62a-ce8284461cd7
x-ms-request-id: d6cd3373-bbb7-4bbc-8c8e-a99e2f998513
x-ms-correlation-id: d7f8b4d0-f23e-48b6-9109-75a22e6f00cf
x-ms-correlation-request-id: 885e3b11-2393-44a8-80a8-1ccd57318bd3
x-ms-client-request-id: d7d1f605-b216-4d1e-9429-2afe8906e7b1
X-Powered-By: ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-routing-request-id: WESTEUROPE:20220224T084156Z:885e3b11-2393-44a8-80a8-1ccd57318bd3
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Thu, 24 Feb 2022 08:41:56 GMT
{"error":{"code":"422","message":"This operation is not supported in the version specified in the request. Please use version 2018-12-01-preview-preview or later. (Request ID: d6cd3373-bbb7-4bbc-8c8e-a99e2f998513)"}}
As you can see, something is outdated. I tried updating the Az modules in the automation account and Az.Billing specifically, but so far no success. I haven't found anyone with a similar problem.
What is happening?
edit:
The problem started appearing out of the blue february 1st. We weren't working on these systems and no changes were made in our Azure environment's configuration.