简体   繁体   English

Azure function 与 docker 图像抛出即使存在也会引发缺少连接字符串错误

[英]Azure function with docker image throwing throws missing connection string error even though present

I have a custom docker image that I am trying to run azure functions on and I managed to get the function running but the code throws the following error我有一个自定义 docker 图像,我正在尝试运行 azure 函数,我设法让 function 运行,但代码抛出以下错误

: Host.Startup[515]
      A host error has occurred during startup operation '48758bfd-0fc4-4ac1-bcba-042a0338e561'.
System.InvalidOperationException: Microsoft Azure WebJobs SDK ServiceBus connection string 'analysis_SERVICEBUS' is missing or empty.
   at Microsoft.Azure.WebJobs.ServiceBus.ServiceBusAccount.get_ConnectionString()
   at Microsoft.Azure.WebJobs.ServiceBus.Listeners.ServiceBusListener..ctor(String functionId, EntityType entityType, String entityPath, Boolean isSessionsEnabled, ServiceBusTriggerExecutor triggerExecutor, ServiceBusOptions config, ServiceBusAccount serviceBusAccount, MessagingProvider messagingProvider, ILoggerFactory loggerFactory)
   at Microsoft.Azure.WebJobs.ServiceBus.Listeners.ServiceBusListenerFactory.CreateAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.WebJobs.ServiceBus.Triggers.ServiceBusTriggerBinding.CreateListenerAsync(ListenerFactoryContext context)
   at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.ListenerFactory.CreateAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 426
   at Microsoft.Azure.WebJobs.Host.Listeners.HostListenerFactory.CreateAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\HostListenerFactory.cs:line 67
   at Microsoft.Azure.WebJobs.Host.Listeners.ListenerFactoryListener.StartAsyncCore(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ListenerFactoryListener.cs:line 45
   at Microsoft.Azure.WebJobs.Host.Listeners.ShutdownListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ShutdownListener.cs:line 29
   at Microsoft.Azure.WebJobs.JobHost.StartAsyncCore(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs:line 103
   at Microsoft.Azure.WebJobs.Script.ScriptHost.StartAsyncCore(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script/Host/ScriptHost.cs:line 256
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.WebJobs.Script.WebHost.WebJobsScriptHostService.UnsynchronizedStartHostAsync(ScriptHostStartupOperation activeOperation, Int32 attemptCount, JobHostStartupMode startupMode) in /src/azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs:line 266

On my local.settings.json I have already specified the connection string在我的 local.settings.json 我已经指定了连接字符串

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=false",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "UI_URL": "http://localhost:8080/report/",
    "analysis_SERVICEBUS": "my connection string is listed here "
  },
  "Host": {
    "LocalHttpPort": 9991,
    "CORS": "*",
    "CORSCredentials": false
  }
}

Is there something more that I need to do with my docker image to make the code run?我还需要对我的 docker 图像做些什么来使代码运行吗?

In your json configuration, you have analysis_SERVICEBUS nested under Values.在您的 json 配置中,您在 Values 下嵌套了 analysis_SERVICEBUS。 It should be in the root of the json.它应该在 json 的根目录中。

{

    "analysis_SERVICEBUS": "Endpoint=sb://xxxx="

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 azure函数queueTrigger错误-Microsoft Azure WebJobs SDK'[隐藏凭据]'连接字符串丢失或为空 - azure function queueTrigger error - Microsoft Azure WebJobs SDK '[Hidden Credential]' connection string is missing or empty 即使从本地网站可以使用相同的连接字符串,也无法从Azure网站访问SQL Azure DB - Cannot access SQL Azure DB from Azure website even though same connection string works from local website Azure API抛出缺少订阅错误 - Azure API throwing Missing Subscription error Azure Kubernetes服务:即使在CD管道中添加了ImagePullSecret,图像拉出错误(身份验证) - Azure Kubernetes Service: Image Pull Error (Authentication) even though ImagePullSecret was added in CD pipeline Azure连接字符串错误 - Azure Connection String Error Azure 函数 Python docker 容器:无法找到用于此绑定的 Azure 存储连接字符串 - Azure Function Python docker container: Unable to find an Azure Storage connection string to use for this binding Azure简易表连接字符串丢失 - Azure easy table connection string missing 由于未设置连接字符串,因此无法运行azure函数而出现错误 - Unable to run azure function getting error as connection string not set Azure搜索数据源中缺少连接字符串 - Missing connection string in Azure Search data source Azure 存储表 Rest API 正在抛出 403 - 即使通过了身份验证令牌,服务器也无法对请求进行身份验证 - Azure storage tables Rest API is throwing 403 - Server failed to authenticate the request even though auth token is passed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM