在项目中又遇到一个坑,来填坑
//配置sb builder.ConfigureWebJobs((h, b) => { b.AddAzureStorageCoreServices(); b.AddServiceBus(c => { c.ConnectionString = h.Configuration.GetConnectionString("acc_azure");//就是这里读取不到值 c.MessageHandlerOptions.MaxConcurrentCalls = 1; }); });
appsetting.json
{ "ConnectionStrings": { "acc_jd": "Data Source=xxxxx", "acc_azure": "Endpoint=sb://xxxxx;" }, "Logging": { "LogLevel": { "Default": "Warning" } } }
找到json的属性,然后改为始终复制就好了