Key vault secret not extracted properly for azure function using c#

144 Views Asked by At

I tried to access the key vault secrets from the azure function by following the steps provided in the link. I am storing the retrieved values as static variables as below:

    #region [--  Properties --]

    public static string KeyForAPI {​​​​​ get; set; }​​​​​
    public static string ApiEndPoint {​​​​​ get; set; }​​​​​

    #endregion

During the function execution, the values which are being stored in the above static variables are null.

Is there any alternative way in which we can use the keyvault secrets so that this issue can be resolved.

1

There are 1 best solutions below

0
On

I guess the properties in the class should not be static.