Logic App Standard触发器失败:连接正常却报401 token缺失错误
Logic App Standard连接Service Bus触发器401错误:Key 'token' not found in connection profile
先明确返回的错误详情:
{ "statusCode": 401, "headers": { "Cache-Control": "no-store, no-cache", "Pragma": "no-cache", "x-ms-request-id": "xxxx", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "DENY", "Timing-Allow-Origin": "*", "x-ms-apihub-cached-response": "true", "x-ms-apihub-obo": "true", "Date": "Wed, 20 Jul 2022 15:21:08 GMT", "Content-Length": "287", "Content-Type": "application/json", "Expires": "-1" }, "body": { "status": 401, "message": "Key 'token' not found in connection profile.\r\nclientRequestId: 0b492f59-bca5-4901-8132-b0ce10416d25", "error": { "message": "Key 'token' not found in connection profile." }, "source": "servicebus-xxx.azurewebsites.net" } }
可能的问题原因:
- 连接配置未同步到运行时:虽然Connections页面显示"Connected",但Logic App Standard的连接配置可能未正确同步到工作流运行环境。比如连接创建后工作流未重新加载,或者令牌未写入应用设置/连接存储。解决方式:重启Logic App Standard服务,重新保存连接后重新发布工作流。
- 身份验证配置异常:如果使用托管标识(Managed Identity)或OAuth连接,可能存在令牌获取失败的情况:比如托管标识权限配置后未生效,或者OAuth刷新令牌过期且未自动刷新。解决方式:检查托管标识是否拥有Service Bus的对应权限(如Azure Service Bus Data Receiver/Sender);若是OAuth连接,重新授权以刷新令牌。
- 连接配置文件损坏:底层连接配置文件(如Logic App连接存储中的JSON)丢失了
token字段,前端状态显示有误。解决方式:删除现有连接,重新创建Service Bus连接,确保配置流程完整无中断。
是否是权限限制导致?
这个错误不是直接的权限限制,典型的权限不足错误会明确提示"Access denied due to missing permissions"类信息。但如果是托管标识权限不足导致无法获取令牌,会间接引发该错误,因此仍需排查身份验证相关的权限配置。
内容的提问来源于stack exchange,提问作者Nmaster88
相关产品推荐
相关产品推荐

