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
328 stars 193 forks source link

[BUG] Allow overriding of API diagnostics in v6 #672

Closed tomsauret21 closed 1 month ago

tomsauret21 commented 1 month ago

Release version

v6.0.1.1

Describe the bug

When deploying APIs that have diagnostic settings included, you will get an error that the extracted diagnostic setting does not exist. It is not overriding the value with what is specified in the configuration file. If we roll back to v5 it will deploy without error

Expected behavior

Be able to deploy APIs with diagnostic settings with the latest version

Actual behavior

Deployments are failing with errors pointing to the logger Id not being updated with the value from the configuration file for that environment.

Reproduction Steps

Extract api ensure it has the Diagnostics folder included in the repository deploy using v6 of the publisher

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.
guythetechie commented 1 month ago

@tomsauret21 - can you post your sample configuration file with the override and the error message?

tomsauret21 commented 1 month ago

Here is a sample from our configuration file

Here is the error we are receiving Application failed. System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/{prod Subscription}/resourceGroups/{prod RG}/providers/Microsoft.ApiManagement/service/{Prod Service}/apis/{API Nome}/diagnostics/applicationinsights?api-version=2023-09-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":"Logger Id '{Dev App Insights name}' does not exist"}]}}'.

If we roll back to v5 of the publisher, the API will deploy without errors. But when using v6 it will fail for every API that has a "Diagnostics" folder included with it.

guythetechie commented 1 month ago

Thank you. We'll get this fixed.