Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 管道不替换数组对象_Azure_Azure Devops_Azure Pipelines - Fatal编程技术网

Azure 管道不替换数组对象

Azure 管道不替换数组对象,azure,azure-devops,azure-pipelines,Azure,Azure Devops,Azure Pipelines,我正在尝试为不同的环境更改日志url和api密钥。为此,我在Azure发布管道中使用变量。目前,数据库连接字符串运行良好 然而,我正在努力使日志变量正常工作。现在,有一个数组,我相信你引用了一个数组作为field.child.1.field(因此,这将分配第二个数组对象的字段) 我有这个: "Serilog": { "MinimumLevel": { "Default": "Debug",

我正在尝试为不同的环境更改日志url和api密钥。为此,我在Azure发布管道中使用变量。目前,数据库连接字符串运行良好

然而,我正在努力使日志变量正常工作。现在,有一个数组,我相信你引用了一个数组作为field.child.1.field(因此,这将分配第二个数组对象的字段)

我有这个:

 "Serilog": {
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],

    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}"
        }
      },
      {
        "Name": "Seq",
        "Args": {
          "serverUrl": "myUrl",
          "apiKey": "myApiKey"
        }
      }
    ]
  }
我正在尝试替换serverUrl和apiKey

在我的pipeline lok中,我看到的是:

  • 2021-03-15T01:24:13.1988119Z压缩:17363747
  • 2021-03-15T01:24:13.2942311Z应用JSON变量替换**/*.JSON
  • 2021-03-15T01:24:13.3272676Z应用JSON变量替换D:\a_temp\temp_web_package_8357506149\appsettings.JSON
  • 2021-03-15T01:24:13.3275828Z替换键上的值:ConnectionString
  • 2021-03-15T01:24:13.3717239Z应用JSON变量替换D:\a_temp\temp_web_package\u 8357506149\MyApp.WebAPI.deps.JSON
  • 2021-03-15T01:24:13.3819830Z应用JSON变量替换D:\a_temp\temp_web_package\u 8357506149\MyApp.WebAPI.runtimeconfig.JSON
  • 2021-03-15T01:24:13.3822015Z JSON变量替换成功应用

它能很好地连接一个字符串,但不能连接其他字符串。我遗漏了什么?

您理解正确。您的错误是
SeriLog.WriteTo.1.Args.apiKey
中的大写字母“L”。它应该是“SeriLog.WriteTo.1.Args.apiKey”。错误出现在变量
apiKey
serverUrl

你这个漂亮的人!区分大小写。啊!谢谢!解决了。@Craig哦,谢谢:)区分大小写在JSON中是一件大事。因为它,我花了很多天来排除故障。