question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Publisher] Suggestion/question for better flexibility in field parameterization

See original GitHub issue

I just came across this tool and it looks promising. However, one feature that I’d miss is being able to parameterize ANY field I want in the API config.yml. I’ve been using dotnet-apim (derived from Azure-apim-devops-toolkit), which allows parameterization of any field in the yaml as well as in any policy files. It also supports if/else conditionals in the yaml. I’m not sure how that could work in apiops, perhaps same kind of syntax in ONE configuration file, instead of having a configuration file for each environment, with field parameterized as $(field). Then the parameterized fields could be passed in through command line options. I think this would provide for easier maintainability and flexibility. I’d be happy to help with the development if needed. Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
guythetechiecommented, Feb 2, 2023

The one downside I found with APIOps is that I have to define a configuration.yml for each and every environment, even if the API only differs by a few properties across environments, which doesn’t work well for my use case, and I don’t think this was addressed in the release aforementioned. Whereas in Bicep I can define a reusable module for all APIs, then have a bicep for each individual API but have each take in environment-specific parameters which can be passed in during deployment. The learning curve for the syntax is a small price to pay at least for my use case. But I do understand not every solution works for everyone.

@levimatheri - We use the default .NET configuration for ApiOps, meaning that we also support command line arguments and environment variables for overrides. Haven’t tested those explicitly, but you should be able to use them instead of a configuration.yml if that works better.

For instance, this configuration.yml

apimServiceName: myapim
namedValues:
  - name: environment
    properties:
      displayName: environment
      value: "https://www.search2.com"

can be translated to the following environment variables:

apimServiceName: myapimservice
namedValues__0__name: environment
namedValues__0__properties__displayName: environment
namedValues__0__properties__value: https://www.search2.com

You can set the environment variables in your higher environment pipeline tasks. While less readable than YAML, they definitely fit certain use cases better. Here’s some documentation on structuring complex environment variables in .NET configuration.

Quick and dirty overrides can also be done at the command line level: publisher.exe --apimServiceName myapimservice. I’m not well-versed in .NET command line configurations, but here’s some documentation.

1reaction
guythetechiecommented, Feb 16, 2023

Updated our Wiki with configuration information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stretching: Focus on flexibility
However, research has shown that stretching can help improve flexibility, and, as a result, the range of motion of your joints. Better flexibility...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found