Right, so the environment objects need go be within the Application Scope. I moved the same and passed the secret parameters from there via function parameters to object. Actually I was trying to achieve something like
this and I converted it to something like
this after passing the secret parameters through Application extension function. This solved the problem I think.Thanks a lot for taking the time to answer. I appreciate it.