1
votes

I want to integrate my azure functions app with the key vault. I followed the steps shown here http://blogs.adatis.co.uk/benjarvis/post/Azure-Functions-Key-Vault-Integration

But facing this error- Value cannot be null. Parameter name: authKeyOrResourceToken

Not sure where I'm going wrong. Any help would be greatly appreciated.

I tried to add an environmental variable named 'authKeyOrResourceToken' under the application settings, proving the value with default func key. But no luck.

This is how my function.json looks like

{ "type": "CosmosDB", "name": "<>", "databaseName": "<>", "collectionName": "<>", "connectionStringSetting": "<>", "sqlQuery": "SELECT * FROM c where c.recordType = {recordType}", "direction": "in" }

While I expect the result of the query, I'm facing the exception.

2

2 Answers

1
votes

connectionStringSetting should have, as value, the name of a setting in your Function App that has a value in the format:

@Microsoft.KeyVault(SecretUri=secret_uri_with_version)

Where secret_uri_with_version is the secret url that contains your Cosmos DB Connection String (full connection string, not just the key).

0
votes

Finally I got it working.

I was writing Azure Function using Node.js. So from this function, if I need to access the key vault, it is expected to install 2 npm modules (azure-keyvault & ms-rest-azure). Once installed, I was able to access the key vault.

Ironically, there is no such dependency for Azure functions written in .net. It works out-of-the-box.