Currently on one of my project, I've an Azure function (NodeJS 16) running to be triggered on a blob creation and that need to take few informations and saved them to a cosmos db. For that I use a Cosmos DB output binding.
At the start, I used the classic connection for that with the connection string. It worked well. But now, I don't want to deal with the rotation of the keys for this connection string. That's why I wanted to move to the version 4+ of the azure extension in order to connect with Managed System Identity.
Right now it works well for the blob trigger with MSI, it is triggered and it run the function. But at the end, when I do the context.done() in order to save the datas to the cosmos db, I get this error.
2022-10-31T15:59:00.203 \[Error\] Executed 'Functions.SaveToCosmosDB' (Failed, Id=9162f53b-8c79-44bf-82b9-ca9c4267cc76, Duration=359ms)
Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified
I'm stuck with it since fews days. I don't get it, why do I get a .NET package error ? I'm using a NodeJS function. Do someone already get this issue before ? Or am I wrong with my configuration ?
Thanks in advance for your help
Here is my host.json:
{
"version": "2.0",
"extensionBundle":
{
"id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
"version": "[4.*, 5.0.0)"
}
}
and here is my function.json
{
"bindings": [
{
"name": "imageBlob",
"type": "blobTrigger",
"direction": "in",
"path": "images/{name}.bmp",
"connection": "MYAPP_BLOB"
},
{
"direction": "out",
"name": "metadata",
"type": "cosmosDB",
"databaseName": "MYAPP_COSMOS_DATABASE",
"containerName": "MYAPP_COSMOS_CONTAINER",
"connection": "MYAPP_COSMOS",
"preferredLocations": "Central US"
}
]
}
When I change from extension version 3+ to 4+, I change the property collectionName to containerName as described in the MS documentation https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-output?tabs=in-process%2Cextensionv4&pivots=programming-language-javascript
But I've seen a mismatch in the documentation, for the .Net version, if we use a 4+ version of the extension, the property ConnectionStringSetting change for Connection but for the JS version of the code, it remains ConnectionStringSetting. Is it normal or is it a typos mistake in the documentation ?
Thanks in advance for your help.