Skip to content

[aks-agent] Fix client mode when Microsoft Entra ID (keyless) provider is selected#9845

Merged
yanzhudd merged 2 commits intoAzure:mainfrom
mainred:fix-entra-id-client-mode
May 5, 2026
Merged

[aks-agent] Fix client mode when Microsoft Entra ID (keyless) provider is selected#9845
yanzhudd merged 2 commits intoAzure:mainfrom
mainred:fix-entra-id-client-mode

Conversation

@mainred
Copy link
Copy Markdown
Member

@mainred mainred commented May 5, 2026

Summary

  • Fix client mode when Microsoft Entra ID (keyless) provider is selected by passing AZURE_AD_TOKEN_AUTH=True to the Docker container when no API key is configured for an Azure model
  • Bump version to 1.0.0b23

Test plan

  • Run az aks agent-init and select client mode with Microsoft Entra ID (keyless) provider
  • Run az aks agent and verify the agent authenticates via Azure AD token

…ure OpenAI

When using Microsoft Entra ID (keyless) provider in client mode, set the
AZURE_AD_TOKEN_AUTH=True environment variable in the Docker container so
the agent authenticates via Azure AD token instead of an API key.

Bumps version to 1.0.0b23.
@mainred mainred requested a review from feiskyer as a code owner May 5, 2026 00:23
Copilot AI review requested due to automatic review settings May 5, 2026 00:23
@mainred mainred requested a review from nilo19 as a code owner May 5, 2026 00:23
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 5, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 5, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes client-mode authentication when using the Azure OpenAI Microsoft Entra ID (keyless) provider by ensuring the Docker container is configured to use Azure AD token auth when no API key is present, and bumps the extension version to 1.0.0b23.

Changes:

  • Pass AZURE_AD_TOKEN_AUTH=True into the client-mode docker run invocation when an azure/... model has no api_key.
  • Bump aks-agent extension version to 1.0.0b23.
  • Add release note entry for 1.0.0b23.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py Adds conditional env var injection for Azure AD token auth in client-mode Docker execution.
src/aks-agent/setup.py Bumps package version to 1.0.0b23.
src/aks-agent/HISTORY.rst Adds 1.0.0b23 release note entry describing the fix.

Comment thread src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py Outdated
Comment thread src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py
…client mode

Add tests covering exec_aks_agent to assert AZURE_AD_TOKEN_AUTH=True is
included in the Docker command when an azure/ model has no api_key or a
whitespace-only api_key, and excluded when a valid api_key is present.

Also align the empty-API-key check with _create_helm_values by treating
whitespace-only api_key values as empty via .strip().
@yanzhudd yanzhudd merged commit 0451e76 into Azure:main May 5, 2026
22 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented May 5, 2026

[Release] Update index.json for extension [ aks-agent-1.0.0b23 ] : https://dev.azure.com/msazure/One/_build/results?buildId=162912488&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants