Why does returning a variable take so long?

Product: PowerShell Universal
Version: v4

script : return $Secret:graphsecret

We are running latest version of 4 and hosting our DB using SQL in azure.


Why would this process take 22 seconds with the integrated environment?

When calling a secret variable, it retrieves the variable from the database and then decrypts the value. It should be almost instant. The serialization should take a few milliseconds. The database query should also be really quick unless you have tens of thousands of secret variables.

Increasing the system log level may help determine where the slow down could be coming from.

I think this had something to do with us running SQL in azure. We ended up reverting to a local db for now.