简体   繁体   English

Azure 逻辑应用程序:Azure VM 连接器 - InvalidAuthenticationTokenTenant

[英]Azure Logic App: Azure VM Connector - InvalidAuthenticationTokenTenant

I'm try to use the Azure VM Connector to start and stop a Virtual Machine.我正在尝试使用Azure VM 连接器来启动和停止虚拟机。

When I edit the Logic App it uses my User Id to authenticate (successfully).当我编辑逻辑应用程序时,它使用我的用户 ID进行身份验证(成功)。

However, my User Id is in a different Tenant than the VM.但是,我的用户 ID与 VM 位于不同的租户中。 The Start Virtual Machine connector allows you to specify the SubscriptionId , ResourceGroup , and VM Name , but not the TenantId .启动虚拟机连接器允许您指定SubscriptionIdResourceGroupVM Name ,但不能指定TenantId

I get an Authorization (401) error ( InvalidAuthenticationTokenTenant ) when I try to run the Logic App .我尝试运行Logic App时收到授权 (401) 错误 ( InvalidAuthenticationTokenTenant )。 How can I specify the correct TenantId to get it working?如何指定正确的TenantId以使其正常工作?

"error": { "code": "InvalidAuthenticationTokenTenant", "message": "The access token is from the wrong issuer 'https://sts.windows.net/a35caae4-15e1-4518-bd0f-c1fd0f22814c/'. It must match the tenant 'https://sts.windows.net/600ab0db-7c24-401f-b5be-d765e88dfb09/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/600ab0db-7c24-401f-b5be-d765e88dfb09b' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later." "error": { "code": "InvalidAuthenticationTokenTenant", "message": "访问令牌来自错误的颁发者 'https://sts.windows.net/a35caae4-15e1-4518-bd0f-c1fd0f22814c/'。它必须与此订阅关联的租户“https://sts.windows.net/600ab0db-7c24-401f-b5be-d765e88dfb09/”匹配。请使用权限(URL)“https://login.windows.net/600ab0db” -7c24-401f-b5be-d765e88dfb09b' 来获取令牌。请注意,如果订阅转移到另一个租户,则对服务没有影响,但有关新租户的信息可能需要一段时间才能传播(最多一个小时)。如果您刚刚转移订阅并看到此错误消息,请稍后再试。” } }

I solved the problem by doing 3 things:我通过做 3 件事解决了这个问题:

  1. Enable Managed Identities for the Logic App为逻辑应用启用托管标识
  2. Add a new role assignment in the VMs Access Control (IAM) section for the Logic App在逻辑应用的 VM 访问控制 (IAM) 部分添加新的角色分配
  3. Updated the Start virtual machine task in the Logic App to connect using the managed identity更新了逻辑应用中的启动虚拟机任务以使用托管标识进行连接

The following link regarding Azure Functions to Start/Stop VMS provided the basic steps that I applied to the Azure Logic App(s) in my case.以下关于Azure 功能启动/停止 VMS的链接提供了我应用于 Azure 逻辑应用程序的基本步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM