Azure-functions-durable-extension: [Question] Is it possible to access Azure Key vault in Durable functions?

Created on 10 May 2019  路  2Comments  路  Source: Azure/azure-functions-durable-extension

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

Needs

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

All 2 comments

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... :)

Was this page helpful?
0 / 5 - 0 ratings