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

[Question] Override policies in higher environments #657

Closed karthikpeddi115 closed 2 months ago

karthikpeddi115 commented 2 months ago

Release version

v6.0.1.1

Question Details

Hi Team, We have a requirement to override the policies which are resided under extracted artifacts folder. artifacts/apis/apiname/operations/policy.xml

Picture1

We came to know that we need to use named values to override the above policies, but as per our artifacts, namedvalues has a different information which is looking like below.

Picture2

I have gone through closed cases and it is more likely looking like this case https://github.com/Azure/apiops/issues/300 and https://github.com/Azure/apiops/issues/281

Not able to understand, how can I override over policy.xml details in the below named values. Can you please make an example for the same?

Picture3

Expected behavior

As per the first image, I want to override rate limit value in the policy from 40 to 100 in higher environments.

Actual behavior

Not able to find solution on how to override policy details using namedvalues, please provide an example.

Reproduction Steps

Not able to find solution on how to override policy details using namedvalues, please provide an example.

github-actions[bot] commented 2 months 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.
riosengineer commented 2 months ago

You need to create a namedValue across each APIM instance that has the same name, e.g. rateLimitValue

Your policy XML will simply contain a variable of this name instead of the numerical value currently:

{{rateLimitValue}}

Then using the override prod.yaml file you can simply override the value for each higher instance like so:

namedValues:
- name: rateLimitValue
  properties:
    displayName: rateLimitValue
    secret: false
    value: 100
waelkdouh commented 2 months ago

@karthikpeddi115 please search open and closed issues before opening new ones. This has been discussed in the past.