Skip to content

[BUG] Unable to use Azure CLI as not installed on image #1809

@gstephenhr

Description

@gstephenhr

Describe the bug

Unable to use Azure CLI auth with ~/.azure mapped without Azure CLI installed on the image.

I've extended the image with AzCLI installed and it works.

Based on https://github.com/microsoft/mcp/blob/main/servers/Azure.Mcp.Server/TROUBLESHOOTING.md#use-specific-credentials-only AZURE_TOKEN_CREDENTIALS=AzureCliCredential should work and so Azure CLI should be included in the image.

Expected behavior

calling:

docker run -it --rm --volume /home/user/.azure:/root/.azure --env AZURE_TOKEN_CREDENTIALS=AzureCliCredential mcr.microsoft.com/azure-sdk/azure-mcp:latest

should authenticate based on token from user previously running: az login and start container

Actual behavior

container exits with below in logs

{ "status": 401, "message": "Authentication failed. Please run 'az login' to sign in to Azure. Details: Azure CLI not installed. To mitigate this issue, please refer to the
troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting.", "results": { "message": "Azure CLI not installed", "type": "CredentialUnavailableException" },
"duration": 0 }

Reproduction Steps

az login
docker run -it --rm --volume /home/user/.azure:/root/.azure --env AZURE_TOKEN_CREDENTIALS=AzureCliCredential mcr.microsoft.com/azure-sdk/azure-mcp:latest

Environment

WSLv2 RHEL8 Bash Docker 29.2.1 Azure CLI 2.83.0 mcr.microsoft.com/azure-sdk/azure-mcp:latest

Metadata

Metadata

Assignees

Labels

customer-reportedneeds-team-attentionWorkflow: This issue needs attention from Azure service team or MCP team.packages-DockerDocker container / setup installerquestionFurther information is requestedserver-Azure.McpAzure.Mcp.Server

Type

No type

Projects

Status

Not Started

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions