mcp icon indicating copy to clipboard operation
mcp copied to clipboard

[BUG]Azure MCP could not auth even though az login succeeds

Open bryanchen-d opened this issue 1 month ago • 5 comments

Describe the bug

Azure MCP tools fail to query kusto database which I have access to.

Expected behavior

The MCP tool should be able to query kusto database.

Actual behavior

The mcp tool fails saying it fails to auth, even though I have run the az login and successfully completed and am able to run other az command like 'az account' in the terminal.

Image

Reproduction Steps

Steps:

  1. in VS Code, install Azure MCP server
  2. open copilot chat, enabled the azure mcp server tools
  3. ask it to make some kusto queries

Environment

Note I am able to make query using kusto data explorer.

bryanchen-d avatar Nov 07 '25 00:11 bryanchen-d

Thanks for reaching out and reporting this issue, @bryanchen-d! @xiangyan99 can you please take a look?

joshfree avatar Nov 07 '25 16:11 joshfree

ChainedTokenCredential attempts a list of credentials.

If you want to use cli for the authentication, can you try set env var AZURE_TOKEN_CREDENTIALS="azureclicredential"?

xiangyan99 avatar Nov 07 '25 17:11 xiangyan99

If you want to use cli for the authentication, can you try set env var AZURE_TOKEN_CREDENTIALS="azureclicredential"?

this wouldn't be the end result of this issue though, right? Bryan wanted to use the Azure MCP Server kusto tools and couldn't... az CLI was the quickest thing to grab to manipulate to try to get this working.

He was trying that as a way to unblock himself, not because that was the issue. We still need to understand why it didn't work in the first place.

TylerLeonhardt avatar Nov 07 '25 17:11 TylerLeonhardt

If you want to use cli for the authentication, can you try set env var AZURE_TOKEN_CREDENTIALS="azureclicredential"?

this wouldn't be the end result of this issue though, right? Bryan wanted to use the Azure MCP Server kusto tools and couldn't... az CLI was the quickest thing to grab to manipulate to try to get this working.

He was trying that as a way to unblock himself, not because that was the issue. We still need to understand why it didn't work in the first place.

Yes. This step will help us narrow down the issue and determine whether the authentication failed within the CLI or before reaching the CLI credentials.

xiangyan99 avatar Nov 07 '25 17:11 xiangyan99

@xiangyan99 , I tried setting that env var but it still fails with the same error.

bryanchen-d avatar Nov 07 '25 17:11 bryanchen-d