Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Question] Can we reduce the API PUT Parallelism? Publisher is Failing when Tags are in multiple APIs

未关闭
#770 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/apiops 的其他 Issue

查看 Azure/apiops 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。