我无法在本地运行我用 java 编写的 azure 函数,该函数应该基于 BlobTrigger 工作。
我面临以下错误:
A host error has occurred
Microsoft.WindowsAzure.Storage: No connection could be made because the target machine actively refused it. System.Net.Http: No connection could be made because the target machine actively refused it. System.Private.CoreLib: No connection could be made because the target machine actively refused it.
这是我的代码:
public class Function {
@FunctionName("BlobTrigger")
@StorageAccount("reseaudiag")
public void blobTrigger(
@BlobTrigger(name = "content", path = "filer/{fileName}", dataType = "binary",
connection = "AzureWebJobsDashboard"
) byte[] content,
@BindingName("fileName") String fileName,
final ExecutionContext context
) {
context.getLogger().info("Java Blob trigger function processed a blob.\n Name: " + fileName + "\n Size: " + content.length + " Bytes");
}
}
仅基于初始运行,我可以开始实现逻辑,但我被阻止运行基本步骤本身。
这是我的 local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=confidential;EndpointSuffix=core.windows.net",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"DataConnectionString": "UseDevelopmentStorage=true",
"ContainerName": "filer"
},
"ConnectionStrings": {
"PlantaoEntities": {
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=confidential;EndpointSuffix=core.windows.net",
"ProviderName": "System.Data.EntityClient"
}
}
}
谢谢你。