[BUG] Publisher gets 400 Putting Backends
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy run-publisher-with-env.yaml và so sánh nội dung named-value được trích xuất với thông tin xác thực backend được gửi qua tools/code/common/Backend.cs tại dòng 415. Theo dõi đường dẫn publisher trong tools/code/publisher/Backend.cs tại các dòng 121 và 172 để xác định lý do named-value bí mật hiện có bị từ chối. Hoàn tất khi pipeline publish thành công mà không có lỗi xác thực 400.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C#
- Star
- 448
- Fork
- 247
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/apiops
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Issue tương tự
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/vscode-azurefunctions#5197 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
microsoft/microsoft-ui-reactor#1274 ·