Man*_*jSS 5 c# connection-string web-config azure azure-webjobs
当我创建新的Azure webjob项目时,我可以在app.config下面的部分中看到connectionstring部分:
<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>
Run Code Online (Sandbox Code Playgroud)
在我的webjob函数中我只与我的应用程序db交互.
- 那么我真的需要为azure webjobs创建另外两个数据库吗?
当我从visual studio运行webjobs时,我收到以下错误:
应用程序:WebJobTest.exe Framework版本:v4.0.30319描述:由于未处理的异常,进程已终止.异常信息:System.InvalidOperationException Stack:位于Microsoft.Azure的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)的System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) WebJobTest.Program.Main()中的.WebJobs.JobHost.Call(System.Reflection.MethodInfo,System.Object)
当我尝试访问webjobs日志时,它显示:WebJob详细信息WebJobTest
确保使用以下格式在Microsoft Azure网站配置中设置名为AzureWebJobsDashboard的连接字符串:DefaultEndpointsProtocol = https; AccountName = NAME; AccountKey = KEY指向存储Microsoft Azure WebJobs运行时日志的Microsoft Azure存储帐户.
我想这是因为没有正确的数据库连接字符串.
- 上述两个错误之间可能存在什么联系?
该AzureWebJobsDashboard连接字符串是可选的-如果你希望能够使用控制板UI的日志等你只需要它
该AzureWebJobsStorage连接字符串是必需的-虽然你可能不使用任何存储实体的WebJobs运行时确实使用了一些斑点和其他存储实体为它自己的跟踪和操作.
添加到马修的回答,AzureWebJobsStorage使用WebJobs SDK时,使用Azure的WebJobs你不必使用WebJobs SDK,所以你不必只需要AzureWebJobsStorage连接字符串.
| 归档时间: |
|
| 查看次数: |
3264 次 |
| 最近记录: |