I am upgrading an existing Function App into v4 runtime.
I'm running and testing it locally via venv.
function.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "documents",
"direction": "in",
"leaseCollectionName": "leases2",
"connectionStringSetting": "AzureWebJobsCosmosDBConnectionString",
"databaseName": "%DBNameFromKeyVault%",
"collectionName": "%CollectionNameFromKeyVault%",
"createLeaseCollectionIfNotExists": true
}
]
}
local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
}
}
i have install what on requirements.txt.
pip install -r requirements.txt
then func start
and i got an error: The 'myfunction' function is in error: Unable to configure binding 'documents' of type 'cosmosDBTrigger'. This may indicate invalid function.json properties. Can't figure out which ctor to call.
This is Azure Functions Core Tools versionL Core Tools Version: 4.0.5198 Commit hash: N/A (64-bit) Function Runtime Version: 4.21.1.20667
I have also did func extension install. it was installed successfully.
My expectation, since I'm only upgrading the function app from v2 to v4, there's no changes in code except for the versions from the requirements.txt, extensions, and runtime.
Do i miss anything? Hope you can help me. Thank you.