Context
A blob triggered function written in Java:
@FunctionName("blob")
public String execute(
@BlobTrigger(name = "test", path = "testcontainer/{name}", connection = "BlobTriggerConnection")
String content, ExecutionContext context) {
// function's code
}
Based on the documentation, to use identity based triggers, following App Settings entries must be created:
BlobTriggerConnection__blobServiceUriBlobTriggerConnection__queueServiceUriBlobTriggerConnection__credential
Moreover, function's identity must have correct permissions on the blob storage.
I've done that in Azure and it works well.
Problem
However, running the function locally along with Azurite fails with the following error:
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.blob'. Microsoft.Extensions.Azure: Unable to find matching constructor while trying to create an instance of BlobServiceClient.
Expected one of the follow sets of configuration parameters:
1. connectionString
2. serviceUri
3. serviceUri, credential:accountName, credential:accountKey
4. serviceUri, credential:signature
5. serviceUri
Found the following configuration keys: queueServiceUri, credential, blobServiceUri.
It is as if identity based triggers aren't supported.
local.settings.json file's content:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "java",
"BlobTriggerConnection__blobServiceUri": "UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1:10000",
"BlobTriggerConnection__credential": "managedidentity",
"BlobTriggerConnection__queueServiceUri": "UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1:10001"
}
}
I'm using the latest version of tools locally:
> brew search azure-functions-core-tools
azure/functions/azure-functions-core-tools@4
I should point out that this is a MacBook with intel's chipset.
Add this in your
local.settings.jsonto resolve your issue:Make sure you add this too
and this is how the
.csfile will look: