apiops icon indicating copy to clipboard operation
apiops copied to clipboard

Ignore ApiDiagnostics with empty loggerId after JSON transform

Open jeroenmaes opened this issue 1 year ago • 3 comments

Scenario: Use the JSON transform capabilities to transform a loggerId to an empty value in order to disable the API logger in a higher environment, but have it still in the repository for the lower environment.

configuration.env.yaml example:

apis:
  - name: petstore-api    
    diagnostics:
      - name: applicationinsights
        properties:
          loggerId: ''

The result is an empty string value for the loggerId field in the JSON payload

PR Changes: When an empty values is found for the required loggerId value for the API call, the call is not executed and a warning is logged instead.

jeroenmaes avatar Apr 16 '24 09:04 jeroenmaes

Hi we just released v6 release candidate. Can you please try to apply your PR on the new code base?

waelkdouh avatar Jul 03 '24 20:07 waelkdouh

Hi we just released v6 release candidate. Can you please try to apply your PR on the new code base?

waelkdouh avatar Jul 03 '24 20:07 waelkdouh

Hi I just did a quick test using the azure apim portal to try to disable the diagnostics settings for an api and when tracking the network traffic it seems that a delete request is being sent to the server. So my question is did you test your suggested solution before you created the PR as your solution doesn't seem correct. image

waelkdouh avatar Jul 05 '24 15:07 waelkdouh