Resolving the ECONNREFUSED Error with VS Code

We were working on a project requiring us to extract data from an API and land it over a data lake storage account container. So, we created an Azure Function App using Visual Studio (VS) code. We set up an environment for the variable using the SETX command locally. While debugging the code, we got an error – “connect ECONNREFUSED 127.0.0.1:9091”, and “on prompt”, it suggested opening “launch.json.”
To fix the issue, we used the “dotenv module” for the environment variable and added the necessary “Certificates” from Snap-in from the console root.