Azure的WebJobs ServiceBus返回例外:发现授权范围内2 DNS索赔 [英] Azure WebJobs ServiceBus returns Exception: found 2 DNS claims in authorization context
问题描述
我试图读取使用Azure的WebJob蔚蓝ServiceBus队列中的消息,但它的投掷和异常:
I'm trying to read a message from an Azure ServiceBus queue using an Azure WebJob but it's throwing and exception:
Unhandled Exception: System.InvalidOperationException: Found 2 DNS claims in authorization context.
我给自己定名为AzureWebJobsServiceBus,AzureWebJobsDashboard和AzureWebJobsStorage正确的连接字符串
I've set the correct connection strings named "AzureWebJobsServiceBus", "AzureWebJobsDashboard" and "AzureWebJobsStorage"
该WebJob计划code已被更新为使用JobHostConfiguration:
The WebJob Program code has been updated to use JobHostConfiguration:
class Program
{
static void Main()
{
var config = new JobHostConfiguration();
config.UseServiceBus();
var host = new JobHost(config);
host.RunAndBlock();
}
}
和实际的工作方法。
public class Functions
{
public async static Task ServiceBusResizeRequest(
[ServiceBusTrigger("blah")] string message,
TextWriter log
)
{
await log.WriteLineAsync("got message " + message);
}
}
我可以成功地创建并通过一个单独的控制台应用程序写入队列。
I can successfully create and write to the queue via a separate console application.
但是,当我运行webjob应用程序,它会抛出该异常。
But when I run the webjob application, it throws that exception.
任何想法?
编辑:使用.NET 4.6.1
Using .net 4.6.1
推荐答案
从.NET 4.6.1降级到4.6似乎prevent问题的发生。
Downgrading from .net 4.6.1 to 4.6 seems to prevent the issue from occurring.
这篇关于Azure的WebJobs ServiceBus返回例外:发现授权范围内2 DNS索赔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!