我正在使用全新的NServiceBus特性,它支持DataBus的Azure托管服务身份。我的实现非常简单,除了为AzureDataBus启用MSI之外,没有任何配置。但是,当NServiceBus更新我的令牌时,我在日志中得到以下输出:
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider' to type 'System.ValueTuple`2[Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider,NServiceBus.DataBus.AzureBlobStorage.DataBusSettings]'.
at NServiceBus.DataBus.AzureBlobStorage.AzureDataBusPersistence.TokenRenewerAsync(Object state, CancellationToken token)
at Microsoft.WindowsAzure.Storage.Auth.TokenCredential.RenewTokenAsync(Object state)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()配置如下:
var dataBus = endpointConfiguration.UseDataBus<AzureDataBus>();
dataBus.AuthenticateWithManagedIdentity(accountName, TimeSpan.FromMinutes(1));我还没能找到任何与此相关的东西。下一步我可以尝试什么?
发布于 2020-06-11 02:02:53
这似乎是NServiceBus如何配置其TokenCredential以进行续订的错误。我已经向他们提交了支持工单进行调查。
解决方案的PR:https://github.com/Particular/NServiceBus.DataBus.AzureBlobStorage/pull/112
当TokenCredential被实例化时,它被提供了与令牌更新者的预期状态不匹配的状态。
https://stackoverflow.com/questions/62308081
复制相似问题