I was very happy to see the ability to prepopulate connection references and enviroment variables in the build tools for Azure Devops (as described here https://docs.microsoft.com/en-us/power-platform/alm/conn-ref-env-variables-build-tools). For me this works great with simple string-based values, but can this method also be used to prepopulate environment variables with more complex type such as JSON. I can't seem to get a grip on how to accomplish this.
Any with any experiences?
{
"EnvironmentVariables": [
{
"SchemaName": "tst_Deployment_env",
"Value": ""
}
}
Hi @larschrjensen :
The format of the JSON string you provided looks wrong:
{
"EnvironmentVariables": [
{
"SchemaName": "tst_Deployment_env",
"Value": ""
} ]
}
Best Regards,
Bof
Hello @larschrjensen
I encountered the same issue. For me, treating JSONs as strings with escaped double quotes worked.
Example
{
"EnvironmentVariables": [
{
"SchemaName": "tst_samplejson",
"Value": "{\"prop1\":\"val1\",\"prop2\":{\"subprop1\":\"val2\"}}"
}
]
}
You won't have those backslashes in variable value after solution import.