"[WARN] Call failed. An error occurred while sending the request." message in all jobs

"[WARN] Call failed. An error occurred while sending the request." message in all jobs

Version: Any

Root Cause
When PowerShell Universal starts a new job, it uses the Management API to retrieve job information from the server. It does this over HTTP and will generate a Read-Only app token for the identity of the user that started or scheduled the job. The web server uses internal APIs to determine the URL of the management API. If PowerShell Universal is hosted behind a remote proxy, like IIS, or cannot determine the web server URL, it will fail to connect and report the warning message:
[6:08:48 PM] [WRN] Call failed. An error occurred while sending the request. GET https://localhost/api/v1/Job/329

Resolution
To resolve this issue, you will need to configure the application settings. This can be accomplished be editing the appsetting.json file, environment variables or command line arguments. You can learn more about application configuration settings on the documentation.
When using the appsettings.json file, you will need to update the API \ URL property to include the root of your web server address. For example, if your web server was listening on https://ironmanpsu:448,/ you could updated the JSON file like this.
  1.   "Api": {
  2.     "Url": "https://ironmanpsu:448"
  3.   },
Instead of trying to determine the API URL via internal APIs, PowerShell Universal will now pass this value to all PowerShell Environments (including jobs) so that the cmdlets use the proper URL.