Reputation: 363
I'm try to use the Azure VM Connector to start and stop a Virtual Machine.
When I edit the Logic App it uses my User Id to authenticate (successfully).
However, my User Id is in a different Tenant than the VM. The Start Virtual Machine connector allows you to specify the SubscriptionId, ResourceGroup, and VM Name, but not the TenantId.
I get an Authorization (401) error (InvalidAuthenticationTokenTenant) when I try to run the Logic App. How can I specify the correct TenantId to get it working?
"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." }
Upvotes: 2
Views: 1575
Reputation: 363
I solved the problem by doing 3 things:
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.
Upvotes: 1