1
votes

I am on 3.3.20 and am running into an issue with my json config transforms on arrays. I have tried to setup my variables like the foo:bar:1 example at the bottom of their documentation here https://octopus.com/docs/guides/deploying-asp.net-core-web-applications/json-configuration-variables-feature

Deployment Warning:

Unable to set value for ISeries:WebServices:RemoteBaseUrls:0. The property at ISeries.WebServices.RemoteBaseUrls is a Array.

Unable to set value for ISeries:WebServices:RemoteBaseUrls:1. The property at ISeries.WebServices.RemoteBaseUrls is a Array.

Unable to set value for ISeries:WebServices:RemoteBaseUrls:2. The property at ISeries.WebServices.RemoteBaseUrls is a Array.

Project Variables: Array Variables

Config file:

{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
        "Default": "Warning"
    }
  },
  "ISeries": {
    "WebServices": {
        "RemoteBaseUrls": [
            "http://1.1.1.1:11111/web/services/",
            "http://1.1.1.1:22222/web/services/",
            "http://1.1.1.1:33333/web/services/"
        ]
    }
   }
}
1
I have also tried replacing the variable with an entire array like the foo:bar example but it escapes the [] so ISeries:WebServices:RemoteBaseUrls is replaced with "[\"10.1.0.130:10177/web/services\",\"10.1.0.130:10199/web/services\",\"10.1.0.130:10233/web/services\"]"chrisLawrence

1 Answers

0
votes

The Octopus documentation shows a nested array under the "foo" property, where you have an object WebServices nested inside the ISeries object. I am not sure if this is the issue, but the docs don't say anything about supporting nested objects. Try setting your configuration as:

"ISeries": {
        "RemoteBaseUrls": [
            "http://1.1.1.1:11111/web/services/",
            "http://1.1.1.1:22222/web/services/",
            "http://1.1.1.1:33333/web/services/"
        ]
   }

And your variables as:

ISeries:RemoteBaseUrls:0