Hi, Trying to build a durable function which has to access KeyVault and get some secured creds to process further. however, it seems there is a technical limitation in it. Not getting any exception, the function is just dying when it hit the line keyvault.getsecretasync.
Surprisingly this is working in a normal Azure function and sort of working in local debugging as well. Any thoughts?
`var tokenProvider = new AzureServiceTokenProvider();
var keyvaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(tokenProvider.KeyVaultTokenCallback));
var userId = await keyvaultClient.GetSecretAsync(ConfigurationManager.AppSettings.Get("UserIdVault")).ConfigureAwait(false);
log.Info("got user id");`
Thanks
-Srikanth
My guess is that you're using the key vault client in an orchestrator function? That's not allowed, because doing any I/O in an orchestrator function is forbidden. Instead, you should do that in an activity function. Otherwise you will run into problems just like this.
You can find more information on how orchestrator functions work and their limitations in this documentation:
https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-checkpointing-and-replay
Hi Chris, thanks for this. I found the silly mistake what I'm doing... :)
Most helpful comment
My guess is that you're using the key vault client in an orchestrator function? That's not allowed, because doing any I/O in an orchestrator function is forbidden. Instead, you should do that in an activity function. Otherwise you will run into problems just like this.
You can find more information on how orchestrator functions work and their limitations in this documentation:
https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-checkpointing-and-replay