Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
275 stars 162 forks source link

[BUG] APIM diagnostics App insights publish failed first time, when I publish run pipeline again and select publish all artifact publish is getting success, it will happen every time. #549

Open JashwanthGuvvala opened 1 month ago

JashwanthGuvvala commented 1 month ago

Release version

5.1.3

Describe the bug

APIM diagnostics App insights publish failed first time, when I publish run pipeline again and select publish all artifact publish is getting success, it will happen every time without making any changes in QA config file and getting below error.

System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/rg-test/providers/Microsoft.ApiManagement/service/ag-int-test/diagnostics/applicationinsights?api-version=2022-04-01-preview failed with status code 412. Content is '{"error":{"code":"PreconditionFailed","message":"Exception of type 'Microsoft.WindowsAzure.ApiManagement.Management.Core.Exceptions.PreconditionFailedException' was thrown.","details":null}}'.

Expected behavior

without make any changes in QA config file, it should be published.

Actual behavior

when I approve PR, publish pipeline will start trigger to dev env and it will get success. When I approve changes to QA it's getting failed. when I run manual trigger and select publish all artifact, publish is getting success. I haven't done any changes in QA env config file before approving PR. I was already configured all loggers and diagnostics inside the QA config file.

Without manual pipeline trigger, changes to go to QA env's.

Reproduction Steps

Rename App insight name and add newly modified App insight in APIM logger and update it into named values and also update modified appinsights name into QA config file.

github-actions[bot] commented 1 month ago
  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.