Azure DevOps Pipeline Json Variable Substitution - Ocelot.json

Viewed 158

I have the following file ocelot.json and I want to change the Host object of each route configured inside the file through a variable. I want to change the localhost to the correct hostname through a variable.

"Routes": [
    //ParĂ¡metricas
    {
      "UpstreamPathTemplate": "/api/ClasificacionEquipo",
      "UpstreamHttpMethod": [ "GET" ],
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 19007
        }
      ],
      "DownstreamPathTemplate": "/api/ClasificacionEquipo",
      "FileCacheOptions": {
        "TtlSeconds": 3600,
        "Region": "parametricas"
      }
    },
    {
      "UpstreamPathTemplate": "/api/ClasificacionEquipo/{id}",
      "UpstreamHttpMethod": [ "GET" ],
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 19007
        }
      ],
      "DownstreamPathTemplate": "/api/ClasificacionEquipo/{id}",
      "FileCacheOptions": {
        "TtlSeconds": 300,
        "Region": "parametricas"
      }
    }
]

I create the following variable but it doesn't take me the change: Routes.DownstreamHostAndPorts.Host.

I have also tried as follows: Routes.*.DownstreamHostAndPorts.0.Host

And it hasn't worked for me

1 Answers
Related