Skip to content
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

[Question] Env specific serviceUrl not getting updated #442

Closed
KumarNaveen26 opened this issue Dec 7, 2023 · 2 comments
Closed

[Question] Env specific serviceUrl not getting updated #442

KumarNaveen26 opened this issue Dec 7, 2023 · 2 comments

Comments

@KumarNaveen26
Copy link

Release version

v5.0.0

Question Details

I have my api which is using the Webservice http url for backend.

<set-backend-service base-url="DEV_ENV_URL" />

I want this to be updated for prod env. So in my configuration.prod.yaml file, I have provided new value for serviceUrl as below

apis:
  - name: NAME_OF_THE_API
    properties:
      serviceUrl: PROD_ENV_URL

Even after publishing it successfully, prod has the url of dev env. Could you please let me know what could be the issue.

Expected behavior

base-url in prod should be updated with PROD_ENV_URL.

Actual behavior

base-url in prod has the same value as DEV_ENV_URL.

Reproduction Steps

NA

Copy link

github-actions bot commented Dec 7, 2023

  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.

@waelkdouh waelkdouh changed the title [Question] Env specific serviceUrl not gett8ing updated [Question] Env specific serviceUrl not getting updated Dec 7, 2023
@guythetechie
Copy link
Contributor

@KumarNaveen26 - The configuration change you made will override the service URL of the API, like this:
image

However, the code you provided (<set-backend-service base-url="DEV_ENV_URL" />) is a policy. This won't be affected by API configuration changes. The best way to override policy values across environments is with named values.

  1. Create a named value in DEV with the desired backend URL.
  2. Update your policy to use the named value (<set-backend-service base-url="{{base-url-named-value}}" />). Keep the double brackets.
  3. Update your named value configuration in PROD with the appropriate PROD URL.
namedValues:
  - name: base-url-named-value
    properties:
      value: https://myproductionurl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants