【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub的解决之法

问题描述

在上一次的博文中,我们提到了使用“ 【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub ” 无法成功连接到Event Hub,报错 “ 2024-08-17T08:40:30Z   [Error]   An exception occurred while retrieving properties for Event Hub: logicapp. Error Message: 'ClientSecretCredential authentication failed: AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.”

 

问题解答

上次分析问题,是因为Logic App服务后台使用的Event Hub Extension在设置authority上没有生效的原因。上次提供的替代方案是使用connection string 或者是 managed identity 方式连接Event Hub。 

 

其实,还有另外一种更好的解决方案,可以继续使用Active Directory OAuth进行认证。Event Hub Extension可以直接从环境变量中读取Authority设置。所以只需要在Logic App的环境变量中设置AZURE_AUTHORITY_HOST。

 AZURE_AUTHORITY_HOST  =  https://login.partner.microsoftonline.cn/

设置如下:

 

参考文档

How to use Azure.Identity with Azure Government Cloud, Azure German Cloud, and Azure China Cloud : https://blog.jongallant.com/2020/02/azure-identity-other-clouds/#google_vignette


使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub : https://www.cnblogs.com/lulight/p/18364675

 

posted @   路边两盏灯  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-09-09 【Azure 应用服务】Azure App Service 在不配置自定义域名的情况下如何使用呢?
2020-09-09 【Azure云服务 Cloud Service】Cloud Service的实例(VM)中的服务描述Software Protection 与 Windows Defender, 如何设置Windows Defender Antivirus服务
点击右上角即可分享
微信分享提示