[Question] Can we reduce the API PUT Parallelism? Publisher is Failing when Tags are in multiple APIs
@guythetechie 已经在做这个了。
开始于 2025年7月5日。
评估
这个 Issue 还没有评估数据。
描述
Release version
v6.0.1.7
Question Details
Hi @waelkdouh, I'm running into an issue pushing a suite of APIs up to an APIM instance for the first time after iteratively working through them in the lower env. In the lower env, this error didn't happen because the APIs were pushed at different times. The symptom is an APIM validation error where it says the Tag already exists.
##[error]System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/{RG-NAME}/providers/Microsoft.ApiManagement/service/{APIM-NAME}/apis/{API-ID};rev=1?api-version=2023-09-01-preview&asyncId=686943edfb42681084660528&asyncCode=200 failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"name","message":"Tag with the same name already exists."}]}}'.
Someone else saw this same validation when doing API pushing using Bicep.
In my case, I have some APIs that are part of a public/private "pair" where the public API has fewer Operations than its private counterpart. But, in the spec, they share the same tags because in the case where the Operation is in both, the operation spec is mostly identical.
My feeling is the Parallelism in the PUT operations is causing APIM to act defensively and is rejecting the PUT because it feels the API-tag already exists.
Can we tell the CLI to do PUTs one at a time? I've not found in the docs whether or not this is possible.
best wishes
Expected behavior
When re-using API Tags in the Operations in a spec and that tag is used in multiple APIs like this:
paths: /: get: tags: - TagName
I'd like to be able to push them without the APIM resource rejecting it with a validation error
Actual behavior
APIM says the tag already exists. I presume because the APIOps CLI sees that it doesn't exist and wants to PUT the api tag but another parallel put has created that tag so the 'if !exists, put new else, update/reuse' logic in the CLI is running into an issue.
Reproduction Steps
I believe to reproduce this you'd use two apis, both sharing API tags and having highly congruent operations but fewer operations in one of them.
- 主要语言
- C#
- 星标
- 448
- 派生
- 247
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/apiops 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 70/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
-
Type: enhancement
难度 2/5 1-3 小时 新手友好度 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/vscode-azurefunctions#5197 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
microsoft/microsoft-ui-reactor#1274 ·