我可以在没有AzureWebJobsStorage连接字符串的情况下执行Azure Webjobs吗? [英] Can i execute Azure webjobs without AzureWebJobsStorage connectionstring?

查看:60
本文介绍了我可以在没有AzureWebJobsStorage连接字符串的情况下执行Azure Webjobs吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建新的Azure webjob项目时,我可以在 app.config 部分中看到connectionstring部分,如下所示:

When i create new Azure webjob project i could see the connectionstring section in app.config section as below:

<connectionStrings>
    <!-- The format of the connection string is "DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY" -->
    <!-- For local execution, the value can be set either in this config file or through environment variables -->
    <add name="AzureWebJobsDashboard" connectionString="" />
    <add name="AzureWebJobsStorage" connectionString="" />
  </connectionStrings>

在我的webjob中,功能仅与我的应用程序数据库交互.

IN my webjob Functions im interacting only with my application db.

  1. 那么,我真的需要再为天蓝色的webjobs创建两个数据库吗?

当我从Visual Studio运行webjobs时,出现以下错误:

When i run webjobs from visual studio i'm getting the below error:

应用程序:WebJobTest.exe框架版本:v4.0.30319说明:由于未处理的异常,该过程已终止.异常信息:System.InvalidOperationException堆栈:在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)在Microsoft.Azure.WebJobs.JobHost.Call(System.Reflection.MethodInfo,WebJobTest.Program.Main()上的System.Object)

Application: WebJobTest.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException Stack: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.Azure.WebJobs.JobHost.Call(System.Reflection.MethodInfo, System.Object) at WebJobTest.Program.Main()

当我尝试访问webjobs时,日志显示:WebJob详细信息WebJobTest

And when i try access webjobs log it shows: WebJob Details WebJobTest

确保您设置的连接字符串名为Microsoft Azure网站配置中的AzureWebJobsDashboard通过使用以下格式DefaultEndpointsProtocol = https; AccountName = NAME; AccountKey = KEY指向Microsoft Azure存储帐户,其中Microsoft存储Azure WebJobs运行时日志.

Make sure that you are setting a connection string named AzureWebJobsDashboard in your Microsoft Azure Website configuration by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

我猜这是因为没有正确的数据库连接字符串.

I guess this is because of not having proper database connection string.

  1. 以上两个错误之间可能有什么联系?

推荐答案

添加到Mathew的答案中,仅在使用WebJobs SDK时才需要 AzureWebJobsStorage ,才能使用不必使用的Azure WebJobWebJobs SDK,因此您不必具有 AzureWebJobsStorage 连接字符串.

Adding to Mathew's answer, AzureWebJobsStorage is only required when using the WebJobs SDK, to use Azure WebJobs you don't have to use WebJobs SDK so you don't have to have AzureWebJobsStorage connection string.

这篇关于我可以在没有AzureWebJobsStorage连接字符串的情况下执行Azure Webjobs吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆