gpt4 book ai didi

c# - 尝试创建 Azure 服务总线队列时出现访问错误

转载 作者:行者123 更新时间:2023-11-30 23:18:08 26 4
gpt4 key购买 nike

我在安装了最新版本的 WindowsAzure.ServiceBus NuGet 包的简单控制台应用程序中运行以下代码:

        var connectionString = "Endpoint=sb://<servername>/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<SharedAccessKey>";
var queueName = "TestQueue";

var ns = NamespaceManager.CreateFromConnectionString(connectionString);

if (!ns.QueueExists(queueName))
ns.CreateQueue(queueName);

并收到以下错误:

System.UnauthorizedAccessException was unhandled
HResult=-2147024891
Message=The remote server returned an error: (401) Unauthorized. InvalidSignature: The token has an invalid signature. TrackingId:<GUID>_G30, SystemTracker:<MyQueue>.servicebus.windows.net

我尝试了很多不同的方法来尝试修复它,包括删除并重新创建整个命名空间。我还验证了 SharedAccessKey 具有正确的声明(即管理)。

enter image description here

更新

早上回来继续解决这个问题后,它神秘地开始工作了,所以我猜问题已经变成了,这里发生了什么?代码没有改变。 key 没变。 (困惑!)

最佳答案

您遇到的错误 TrackingId:<GUID>_G30表示网关上的问题 MSFT 支持团队应该能够提供帮助。命名空间管理操作通过 HTTPS 进行,我假设您已打开它,即没有任何东西阻止它。因此,我的赌注是与 Azure 支持人员联系,向他们提供 TrackingId找出网关拒绝您的请求的原因。

关于c# - 尝试创建 Azure 服务总线队列时出现访问错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41029520/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com