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.

Variables in module.json

See original GitHub issue

Expected Behavior

Variables should be substituted in both deployment.template.json and module.json

Current Behavior

I can set variables in .env that are used in deployment.template.json but these aren’t populated in module.json file.

We use different environments for dev and prod and hence different container registrys as well. Currently there doesn’t seem to be a way to use variables in module.json, specifically the repository value. It’d be great to use $CONTAINER_REGISTRY_SERVER in module.json as well as deployment.template.json

Similar to this, an ability for a CI system (e.g. VSTS) to set the tag version in module.json for CI/CD

e.g. module.json could look like

{
    "$schema-version": "0.0.1",
    "description": "",
    "image": {
        "repository": "$CONTAINER_REGISTRY_SERVER/myiotmodule",
        "tag": {
            "version": "$TAG_VERSION",
            "platforms": {
                "linuxx64": "./Dockerfile"
            }
        }
    },
    "language": "csharp"
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
hubezcommented, Feb 2, 2019

Some formal docs on module.json would be nice. Might expose the various consistency issues too. I too was stumped by this and was just about to go down the path of ditching the use of module.json and iotedgedev.

2reactions
shizncommented, Feb 6, 2019

@adashen to share the schema of module.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to refer to variables in a JSON configuration file
Is it possible to use variables within the json file example “security_groups”: “module.nsg.security_groups.id” When I try, it just passes ...
Read more >
Using Variables from Python Script when Importing JSON
The contents of the JSON file don't make sense. The value of report is a string that looks like a Python literal. But...
Read more >
JSON Module
The json variable provides methods to access fields in json objects and indexes in json arrays. 1.4.1.1. Variable lifetime. The json variables will...
Read more >
Save and load Python data with JSON
Reading data from a JSON file ... This function implements the inverse, more or less, of saving the file: an arbitrary variable (f)...
Read more >
Python Tutorial: Working with JSON Data using the json Module
In this Python Programming Tutorial, we will be learning how to work with JSON data. We will learn how to load JSON into...
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 Hashnode Post

No results found