Az 模块问题:Get-AzConclusionBudget 返回 422(不可处理的实体)

发布于 2025-01-14 07:56:31 字数 2630 浏览 5 评论 0原文

https://learn.microsoft.com 在 stackoverflow 上重新发布此内容/en-us/answers/answers/773301/view.html 因为微软 QA 网站已损坏,不允许我对我的帖子发表评论。


原文:

我有一个运行手册,从几周以来,它在获取资源组中的预算列表时返回 422:

     $budgets = Get-AzConsumptionBudget -ResourceGroupName $rg.ResourceGroupName

这在我的测试环境中返回 422。在acc和prd环境下,不会出现这样的错误。这也会不断触发我邮箱中的警报,因此我希望修复此问题。 我也在本地使用 fiddler 运行了这个,这是原始请求数据:

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)"}}

如您所见,有些内容已经过时了。我尝试专门更新自动化帐户和 Az.Billing 中的 Az 模块,但到目前为止没有成功。我还没有找到有类似问题的人。

怎么了?

这个问题从 2 月 1 日开始突然出现。我们没有在这些系统上工作,也没有对 Azure 环境的配置进行任何更改。


更新/额外信息:

所以,这个问题从一个麻烦变成了阻止我测试某些功能。我到处都找过了,但似乎只有我一个人遇到这个问题。

我已经尝试过以下方法: 在本地连接到我们的测试环境,然后运行 ​​Get-AzConspirationBudget。在这里我们得到了原始帖子中的信息。我还注意到它使用以下端点:

GET /subscriptions//providers/Microsoft.Conspiration/budgets?api-version=2018-01-31 HTTP/1.1 ->请注意 api 版本。错误消息为“请使用版本 2018-12-01-preview-preview 或更高版本。”我很乐意,但我坚持使用 PS 模块想要我使用的任何东西。

如果我连接到我们客户的接受环境,它使用相同的端点,但它确实按预期返回预算。它还具有 api-version=2018-01-31。

现在我检查了 Azure 资源浏览器,看看 Microsoft.Conclusion 是否有任何差异,我在两个环境中都发现了这一点:

"resourceType": "Budgets",
"locations": [],
"apiVersions": [
"2021-10-01",
"2019-10-01",
"2019-05-01",
"2019-04-01-preview",
"2019-03-01-preview",
"2019-01-01-preview",
"2019-01-01",
"2018-12-01-preview",
"2018-10-01",
"2018-08-31",
"2018-06-30",
"2018-03-31",
"2018-01-31",
"2017-12-30-preview"
]

这告诉我它们都将 2018-01-31 作为受支持的版本。最后一条信息是,问题可能从 2 月 1 日开始,并于 2 月 2 日出现在我们的日志中。我找不到任何关于 MS 方面是否发生任何变化的信息,至少我们方面没有任何变化。

如果有人知道这是怎么回事,我很想知道。提前致谢。

Reposting this on stackoverflow from https://learn.microsoft.com/en-us/answers/answers/773301/view.html
because the microsoft QA website is broken and won't let me comment on my post.


Original:

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?

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.


Update / Extra info:

So, this problem went from a nuisance to preventing me from testing certain functionality. I have looked everywhere yet I seem to be the only one with this problem.

I have tried the following:
Connected to our test environment locally, and then running Get-AzConsumptionBudget. Here we get the information in the original post. I have also noticed that it uses the following endpoint:

GET /subscriptions//providers/Microsoft.Consumption/budgets?api-version=2018-01-31 HTTP/1.1 -> note the api-version. The error message was "Please use version 2018-12-01-preview-preview or later." I would love to, but I'm stuck with whatever the PS module wants me to use..

If I connect to our client's acceptation environment, It uses the same endpoint but it does return the budgets as expected. It also has api-version=2018-01-31.

Now I checked the Azure Resource explorer to see if there were any differences in Microsoft.Consumption, there I found this in both environments:

"resourceType": "Budgets",
"locations": [],
"apiVersions": [
"2021-10-01",
"2019-10-01",
"2019-05-01",
"2019-04-01-preview",
"2019-03-01-preview",
"2019-01-01-preview",
"2019-01-01",
"2018-12-01-preview",
"2018-10-01",
"2018-08-31",
"2018-06-30",
"2018-03-31",
"2018-01-31",
"2017-12-30-preview"
]

This tells me both of them have 2018-01-31 as a supported version. As a final piece of info, the problems probably started from february 1st, showing up in our logs on february 2nd. I couldnt find any info on whether anything changed on the MS side of things, nothing changed on our side at least.

If anyone knows what's up with this, I'd love to know. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文