'Failed to find matching configuration' unexpectedly displayed in vfagent.net.log


Overview of the Issue

This issue occurs in the following circumstances:

  1. An organization uses Azure App Services to deploy a .NET Application
  2. The Application includes multiple processes that need to separately be tracked by vFunction
  3. The organization creates an Application Setting for the Key VF_MULTI_AGENT_CONF_LOCATION and points to a static configuration.json
  4. The configuration.json is configured with required values for each process
[
  {
    "log_conf": {
      "level": "debug",
      "target_file": "C:\\home\\vfunction\\log\\instances\\Organization.Domain.Director\\vfagent.net.log"
    },
    "port": 9779,
    "instance": "Organization.Domain.Director",
    "shared_folder": "C:\\home\\vfunction\\controller\\instances\\Organization.Domain.Director\\temp",
    "cmd" : "dotnet Organization.Domain.Director.dll"
  },
  {
    "log_conf": {
      "level": "debug",
      "target_file": "C:\\home\\vfunction\\log\\instances\\Organization.Domain.Manager\\vfagent.net.log"
    },
    "port": 9780,
    "instance": "Organization.Domain.Manager",
    "shared_folder": "C:\\home\\vfunction\\controller\\instances\\Organization.Domain.Manager\\temp",
    "cmd" : "dotnet Organization.Domain.Manager.dll"
  }
]
  1. The C:\home\vfunction\log\instances\Organization.Domain.Manager\vfagent.net.log or %TMP%\vfagent.net.log throws the following error
[2024-06-30 16:33:55.854+00:00] [pid 3844] [tid 7924] [vfagent.net] [info] [::] Logging initialized
[2024-06-30 16:33:55.854+00:00] [pid 3844] [tid 7924] [vfagent.net] [info] [ProfilerModule.cpp:ProfilerModule::init:140] loading vfagent.net 3.6.1418
[2024-06-30 16:33:55.854+00:00] [pid 3844] [tid 7924] [vfagent.net] [info] [ProfilerModule.cpp:ProfilerModule::init:141] cmd line: dotnet  Organization.Domain.Manager.dll
[2024-06-30 16:33:55.854+00:00] [pid 3844] [tid 7924] [vfagent.net] [info] [ProfilerModule.cpp:ProfilerModule::init:144] failed to load configuration, aborting agent, err: Failed to find matching configuration in multi conf file cmd: dotnet  Organization.Domain.Director.dll, configured: [dotnet Organization.Domain.Director.dll, dotnet Organization.Domain.Manager.dll]

Steps to Resolve the Issue

This issue can be resolved by taking the following steps:

  1. Copy the exact “cmd line” from the vfagent.net.log. In the example above, there are two spaces between “dotnet” and the name of the DLL in the “cmd line” whereas the configuration.json was configured with only one space
  2. Paste the “cmd line” from the vfagent.net.log into the process-specific CMD configuration.json used for the VF_MULTI_AGENT_CONF_LOCATION
[
  {
    "log_conf": {
      "level": "debug",
      "target_file": "C:\\home\\vfunction\\log\\instances\\Organization.Domain.Director\\vfagent.net.log"
    },
    "port": 9779,
    "instance": "Organization.Domain.Director",
    "shared_folder": "C:\\home\\vfunction\\controller\\instances\\Organization.Domain.Director\\temp",
    "cmd" : "dotnet  Organization.Domain.Director.dll"
  },
  {
    "log_conf": {
      "level": "debug",
      "target_file": "C:\\home\\vfunction\\log\\instances\\Organization.Domain.Manager\\vfagent.net.log"
    },
    "port": 9780,
    "instance": "Organization.Domain.Manager",
    "shared_folder": "C:\\home\\vfunction\\controller\\instances\\Organization.Domain.Manager\\temp",
    "cmd" : "dotnet  Organization.Domain.Manager.dll"
  }
]
  1. Restart the Azure App Services instances or the individual processes