-
Notifications
You must be signed in to change notification settings - Fork 379
Description
Describe the bug
Azure MCP Server seems to only work with a default tenant and doesn't pick up one that is set directly. For example, if you run az login --tenant , that tenant is not selected when you run prompts. Instead, you receive this message:
Your access token is from the wrong Azure tenant for subscription . Please re-authenticate using the authority https://login.windows.net/ and try again. If you recently transferred the subscription, it may take up to....
I received this error in Copilot Chat as well as programmatically. I tried various ways of signing in or switching tenants, but it always just picks the default.
Because tenant is set during az login, and does not have a separate command in the way subscriptions do (az account set <>) - does this mean you cannot use Azure MCP to access resources on other tenants?
Expected behavior
Azure MCP Server should use whatever tenant you signed in with using az login --tenant .
Actual behavior
Azure MCP Server always uses the default tenant (az login with no parameters equivalent, it seems).
Reproduction Steps
- Run az login --tenant
- Attempt to access resources in your targeted tenant ("List my resource groups")
- Provide your target subscription in your target tenant, if prompted
- Error is displayed
Environment
Copilot with VS Code, .NET or Node apps programmatically.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status