我正在尝试连接到 Azure 服务总线,但遇到了问题。\n似乎无法连接,因为我总是收到此错误:
\n\n\nAzure.Identity.AuthenticationFailedException:ClientSecretCredential 身份验证失败:未设置响应,请确保调用 SendAsync
\n
这是我正在尝试做的事情的代码片段
\nvar adminClient = new ServiceBusAdministrationClient(\n mySettings.AzureServiceBus.Endpoint,\n new ClientSecretCredential(mySettings.AzureServiceBus.TenantId,\n mySettings.AzureServiceBus.ClientId, mySettings.AzureServiceBus.ClientSecret));\n\nvar exists = await adminClient.SubscriptionExistsAsync(myTopic, mySubName).ConfigureAwait(false); \nRun Code Online (Sandbox Code Playgroud)\n诊断来自AzureEventSourceListener:
[Informational] Azure-Identity: ClientSecretCredential.GetToken invoked. Scopes: [ https://servicebus.azure.net/.default ] ParentRequestId: 8cd8075d-fb77-4479-bf12-d612fff0de99\n[Informational] Azure-Identity: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [02/01/2023 23:46:30 - ] MSAL MSAL.Desktop with assembly version \'4.30.1.0\'. CorrelationId(e1994990-3e32-43b9-83e5-55a325de668a)\n[Informational] Azure-Identity: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [02/01/2023 23:46:30 - ] === AcquireTokenForClientParameters ===\nSendX5C: False\nForceRefresh: False\n\n[Informational] Azure-Identity: …Run Code Online (Sandbox Code Playgroud)