-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Publish pipeline fails on push_changes_to_Dev_APIM when APIM configured with App Insights #448
Comments
|
Is the logger artifact being extracted? For some reason it's not being included when publishing which is throwing a 400. Also make sure you are not trying publish against a logger that doesn't exist. |
Logger artifact are getting created in repository: { I've added config file with following settings and after that publish pipeline also worked successfully for Dev environment. Looks like publisher fails to parse some settings from logger artifact. apimServiceName: dev-apim-uk-01
|
Yeah the behavior you are experiencing is odd. Usually you only need congifuruation.[env].yaml files for higher environments as you promote your changes and not for the lower environment (typically dev). In your case it seems like you are having to provide a configuration file for the lower environment that has configurations that match what you have already extracted which is unnecessary. @guythetechie any idea what could be causing this behavior? |
Can you show the contents of your DEV |
{ |
I've tried to enable Trace logging and re-run pipeline again to get more details regarding error when there is no config file for Dev environment, but eventually it worked. I will try to do one more test with fresh API. |
Please remember to close the issue once you are ready. |
Release version
APIOPS v5.0.0
Describe the bug
Publish pipeline fails with error message below when publishing artifacts to Dev environment before applying settings to Prod. When skipping publishing to Dev stage, publishing to Prod works fine.
System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/UK-Infrastructure/providers/Microsoft.ApiManagement/service/dev-apim-uk-01/diagnostics/applicationinsights?api-version=2022-04-01-preview failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"loggerId","message":"LoggerId must be specified."}]}}'.
2023-12-17T17:16:08.6694390Z at common.HttpPipelineExtensions.Validate(Response response, Uri requestUri)
2023-12-17T17:16:08.6694832Z at common.HttpPipelineExtensions.PutResource(HttpPipeline pipeline, Uri uri, JsonObject resource, CancellationToken cancellationToken)
2023-12-17T17:16:08.6695292Z at publisher.Program.<>c__DisplayClass13_0.<b__0>d.MoveNext()
2023-12-17T17:16:08.6696593Z --- End of stack trace from previous location ---
2023-12-17T17:16:08.6697127Z at publisher.Diagnostic.PutDiagnostic(DiagnosticName diagnosticName, JsonObject json, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken)
2023-12-17T17:16:08.6697753Z at publisher.Diagnostic.<>c__DisplayClass8_0.<b__0>d.MoveNext()
2023-12-17T17:16:08.6699484Z --- End of stack trace from previous location ---
2023-12-17T17:16:08.6699767Z at System.Threading.Tasks.Parallel.<>c__50
1.<<ForEachAsync>b__50_0>d.MoveNext() 2023-12-17T17:16:08.6700045Z --- End of stack trace from previous location --- 2023-12-17T17:16:08.6730667Z at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable
1 enumerable, Func2 action, CancellationToken cancellationToken) 2023-12-17T17:16:08.6731064Z at publisher.Diagnostic.ProcessArtifactsToPut(IReadOnlyCollection
1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, ILogger logger, CancellationToken cancellationToken)2023-12-17T17:16:08.6731641Z at publisher.Service.ProcessArtifactsToPut(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, GetRestResource getRestResource, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken)
2023-12-17T17:16:08.6732078Z at publisher.Publisher.RunWithoutCommitId(CancellationToken cancellationToken)
2023-12-17T17:16:08.6732301Z at publisher.Publisher.Run(CancellationToken cancellationToken)
2023-12-17T17:16:08.6732511Z at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
2023-12-17T17:16:08.6732697Z info: Microsoft.Hosting.Lifetime[0]
2023-12-17T17:16:08.6732851Z Application is shutting down...
2023-12-17T17:16:08.6733105Z fail: Microsoft.Extensions.Hosting.Internal.Host[9]
2023-12-17T17:16:08.6733268Z BackgroundService failed
Expected behavior
Publish pipeline shouldn't fail when pushing changes to lower-level environment.
Actual behavior
Adjustments of pipeline required in order to get it to work
Reproduction Steps
The text was updated successfully, but these errors were encountered: