Skip to content

External URLs configured in the Settings file

Mark Abrams edited this page Jun 6, 2023 · 1 revision

A workflow may include actions that call APIs and services using the HTTP connector. It is recommended that the URL for the API or service is stored as a setting in the local.settings.json file and not hard-coded in the workflow definition - this allows the workflow to be promoted through environments more easily.

The testing framework can be configured to replace the host name in these URLs with a URL for a mock HTTP server that is managed by the testing framework. The host names to be replaced are configured using the workflow.externalApiUrlsToMock section in the testConfiguration.json file:

"workflow": {
  "externalApiUrlsToMock": [
    "https://external-service-one.testing.net",
    "https://external-service-two.testing.net"
  ]
}

So this setting:

"ServiceOne-Url": "https://external-service-one.testing.net/api/v1/employee",

Will be updated to:

"ServiceOne-Url": "https://local-server-name:7075/api/v1/employee",

NOTE: If the API or service URL is hard-coded in a workflow definition, it will not be updated by the testing framework.

Clone this wiki locally