Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] Publisher gets 400 Putting Backends

オープン
#737 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
32/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
azure, csharp
領域
api, cloud, devops

調査の方向性

まず run-publisher-with-env.yaml を実行し、抽出された named-value の内容と、tools/code/common/Backend.cs の 415 行目を通じて送信される backend credentials を比較します。tools/code/publisher/Backend.cs の 121 行目と 172 行目にある publisher path を追跡し、既存の secret named value が拒否される理由を特定します。パイプラインが 400 validation error なしで正常に publish できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Release version

v6.0.1.4

Describe the bug

Hi,

I'm executing run-publisher-with-env.yaml pipeline and during the Run Publisher task, the Publisher is failing with the following stackstrace:

2025-03-13T09:34:17.1971177Z crit: publisher[0]
2025-03-13T09:34:17.1971989Z       Application failed.
2025-03-13T09:34:17.1973854Z       System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/xxxxxxxx failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"credentials","message":"Property 'func-xxx-xxxx-xxxx-xxx-xxxx-key' not found."}]}}'.
2025-03-13T09:34:17.1974692Z          at common.HttpPipelineExtensions.<>c__DisplayClass11_0.<PutContent>b__0(Response response) in /home/runner/work/apiops/apiops/tools/code/common/Http.cs:line 173
2025-03-13T09:34:17.1976368Z          at LanguageExt.Either.Left`2.Match[B](Func`2 Left, Func`2 Right)
2025-03-13T09:34:17.1976942Z          at common.HttpPipelineExtensions.PutContent(HttpPipeline pipeline, Uri uri, BinaryData content, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Http.cs:line 173
2025-03-13T09:34:17.1977363Z          at common.BackendModule.PutDto(BackendUri uri, BackendDto dto, HttpPipeline pipeline, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Backend.cs:line 415
2025-03-13T09:34:17.1977834Z          at publisher.BackendModule.<>c__DisplayClass11_0.<<GetPutBackendInApim>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 172
2025-03-13T09:34:17.1978134Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1978421Z          at publisher.BackendModule.<>c__DisplayClass7_1.<<GetPutBackend>b__1>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 121
2025-03-13T09:34:17.1978701Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1979001Z          at common.OptionExtensions.IterTask[T](Option`1 option, Func`3 action, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Option.cs:line 22
2025-03-13T09:34:17.1979360Z          at common.OptionExtensions.IterTask[T](Option`1 option, Func`2 action) in /home/runner/work/apiops/apiops/tools/code/common/Option.cs:line 16
2025-03-13T09:34:17.1979833Z          at publisher.BackendModule.<>c__DisplayClass7_0.<<GetPutBackend>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 121
2025-03-13T09:34:17.1980115Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1980345Z          at System.Threading.Tasks.Parallel.<>c__53`1.<<ForEachAsync>b__53_0>d.MoveNext()
2025-03-13T09:34:17.1980576Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1980910Z          at common.IEnumerableExtensions.IterParallel[T](IEnumerable`1 enumerable, Func`3 action, Int32 maxDegreeOfParallelism, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Enumerable.cs:line 61
2025-03-13T09:34:17.1981383Z          at common.IEnumerableExtensions.IterParallel[T](IEnumerable`1 enumerable, Func`3 action, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Enumerable.cs:line 47
2025-03-13T09:34:17.1981768Z          at publisher.BackendModule.<>c__DisplayClass1_0.<<GetPutBackends>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 54
2025-03-13T09:34:17.1982053Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1982334Z          at publisher.AppModule.<>c__DisplayClass1_0.<<GetRunApplication>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/App.cs:line 169
2025-03-13T09:34:17.1982649Z       --- End of stack trace from previous location ---
2025-03-13T09:34:17.1982925Z          at common.HostingModule.RunApplication(IHost host) in /home/runner/work/apiops/apiops/tools/code/common/Hosting.cs:line 89
2025-03-13T09:34:17.1983175Z info: Microsoft.Hosting.Lifetime[0]
2025-03-13T09:34:17.1983362Z       Application is shutting down...
2025-03-13T09:34:17.2061880Z Unhandled exception. System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/xxxxxxxx failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"credentials","message":"Property 'func-xxx-xxxx-xxxx-xxx-xxxx-key' not found."}]}}'.
2025-03-13T09:34:17.2062697Z    at common.HttpPipelineExtensions.<>c__DisplayClass11_0.<PutContent>b__0(Response response) in /home/runner/work/apiops/apiops/tools/code/common/Http.cs:line 173
2025-03-13T09:34:17.2063210Z    at LanguageExt.Either.Left`2.Match[B](Func`2 Left, Func`2 Right)
2025-03-13T09:34:17.2063544Z    at common.HttpPipelineExtensions.PutContent(HttpPipeline pipeline, Uri uri, BinaryData content, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Http.cs:line 173
2025-03-13T09:34:17.2064074Z    at common.BackendModule.PutDto(BackendUri uri, BackendDto dto, HttpPipeline pipeline, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Backend.cs:line 415
2025-03-13T09:34:17.2064557Z    at publisher.BackendModule.<>c__DisplayClass11_0.<<GetPutBackendInApim>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 172
2025-03-13T09:34:17.2064847Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2065149Z    at publisher.BackendModule.<>c__DisplayClass7_1.<<GetPutBackend>b__1>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 121
2025-03-13T09:34:17.2065434Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2065734Z    at common.OptionExtensions.IterTask[T](Option`1 option, Func`3 action, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Option.cs:line 22
2025-03-13T09:34:17.2066094Z    at common.OptionExtensions.IterTask[T](Option`1 option, Func`2 action) in /home/runner/work/apiops/apiops/tools/code/common/Option.cs:line 16
2025-03-13T09:34:17.2066443Z    at publisher.BackendModule.<>c__DisplayClass7_0.<<GetPutBackend>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 121
2025-03-13T09:34:17.2066740Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2066971Z    at System.Threading.Tasks.Parallel.<>c__53`1.<<ForEachAsync>b__53_0>d.MoveNext()
2025-03-13T09:34:17.2067204Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2067541Z    at common.IEnumerableExtensions.IterParallel[T](IEnumerable`1 enumerable, Func`3 action, Int32 maxDegreeOfParallelism, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Enumerable.cs:line 61
2025-03-13T09:34:17.2067984Z    at common.IEnumerableExtensions.IterParallel[T](IEnumerable`1 enumerable, Func`3 action, CancellationToken cancellationToken) in /home/runner/work/apiops/apiops/tools/code/common/Enumerable.cs:line 47
2025-03-13T09:34:17.2068382Z    at publisher.BackendModule.<>c__DisplayClass1_0.<<GetPutBackends>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/Backend.cs:line 54
2025-03-13T09:34:17.2068664Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2069076Z    at publisher.AppModule.<>c__DisplayClass1_0.<<GetRunApplication>b__0>d.MoveNext() in /home/runner/work/apiops/apiops/tools/code/publisher/App.cs:line 169
2025-03-13T09:34:17.2069355Z --- End of stack trace from previous location ---
2025-03-13T09:34:17.2069614Z    at common.HostingModule.RunApplication(IHost host) in /home/runner/work/apiops/apiops/tools/code/common/Hosting.cs:line 89
2025-03-13T09:34:17.2070055Z    at common.HostingModule.RunHost(String[] arguments, String applicationName, Action`1 configureRunApplication) in /home/runner/work/apiops/apiops/tools/code/common/Hosting.cs:line 24
2025-03-13T09:34:17.2070418Z    at publisher.Program.Main(String[] arguments) in /home/runner/work/apiops/apiops/tools/code/publisher/Program.cs:line 10
2025-03-13T09:34:17.2070676Z    at publisher.Program.<Main>(String[] arguments)

I have checked the named values folder of the extracted files and I can find the folder with the same name the log is saying don't find it and the content is similar to this one:

{
  "properties": {
    "displayName": "func-xxx-xxxx-xxxx-xxx-xxxx-key",
    "secret": true,
    "tags": [
      "key",
      "function",
      "auto"
    ]
  }
}

And of course I can find that name value on the original APi Management.

Our Azure Functions are being imported in API Management using the wizard, that's why there is a tag "auto"

I'm wondering if this is happening due to the way we are importing our Azure Functions on API Management or because the named values are secrets.

Expected behavior

Expected successful publishing

Actual behavior

{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"credentials","message":"Property 'func-xxx-xxxx-xxxx-xxx-xxxx-key' not found."}]}}

Reproduction Steps

Execute run-publisher-with-env.yaml

主要言語
C#
スター
448
フォーク
247
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/apiops のほかの issue

Azure/apiops の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。