feat: add az CLI shim for Azure token acquisition via ado-codespaces-auth#95
Merged
markphip merged 8 commits intomicrosoft:mainfrom Jan 13, 2026
Merged
feat: add az CLI shim for Azure token acquisition via ado-codespaces-auth#95markphip merged 8 commits intomicrosoft:mainfrom
markphip merged 8 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds an Azure CLI (az) shim that intercepts az account get-access-token commands to enable Azure SDK authentication in GitHub Codespaces without requiring manual az login. The shim delegates token acquisition to the azure-auth-helper from the ado-codespaces-auth VS Code extension.
Changes:
- Added new
azCLI shim script that intercepts access token requests and falls back to the real Azure CLI for other commands - Integrated the az shim into the artifacts-helper feature with a configurable
azAliasoption - Updated documentation to describe the az shim functionality and usage
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/artifacts-helper/scripts/az | New shim script that intercepts az account get-access-token and delegates to azure-auth-helper |
| src/artifacts-helper/install.sh | Added ALIAS_AZ configuration option and integrated az into the shim installation process |
| src/artifacts-helper/devcontainer-feature.json | Added azAlias boolean option to control az shim installation |
| src/artifacts-helper/README.md | Updated documentation to include az shim description and corrected grammar |
| src/artifacts-helper/NOTES.md | Updated notes to include az shim functionality and corrected grammar |
Comments suppressed due to low confidence (1)
src/artifacts-helper/scripts/az:19
- The variable
$0should be quoted to handle paths containing spaces. Changedirname $0todirname "$0"to prevent word splitting issues.
source "$(dirname $0)"/resolve-shim.sh
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
markphip
requested changes
Jan 13, 2026
Contributor
markphip
left a comment
There was a problem hiding this comment.
Take a look at the Copilot feedback in addition to mine and either just mark items resolved or implement the suggestions it made
markphip
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
azCLI shim that interceptsaz account get-access-tokenrequests and delegates toazure-auth-helperfrom the ado-codespaces-auth VS Code extension. This enables Azure SDK'sDefaultAzureCredential(viaAzureCliCredential) to work seamlessly in GitHub Codespaces without requiring manualaz login.Problem
When using Azure SDKs (e.g., Azure.Identity for .NET, azure-identity for Python) in Codespaces,
DefaultAzureCredentialfails because:az logintimes out waiting for browser-based authenticationAzureCliCredentialfalls back to callingaz account get-access-token --resource <url>, which also failsThis blocks local development of services that access Azure resources like Key Vault, Storage, or ARM.
Solution
The shim:
az account get-access-tokencommands--resource,--scope, or--resource-typeparameterhttps://vault.azure.net/.default)~/azure-auth-helper get-access-token "<scope>"to acquire a token via IPC to VS CodeazCLI output formatazCLI for all other commandsFeatures
--resource <url>(v1.0 endpoint style)--scope <scope>(v2.0 endpoint style)--resource-typewith well-known mappings (arm, ms-graph, aad-graph, batch, data-lake, media, oss-rdbms)ACTIONS_ID_TOKEN_REQUEST_URL)Testing
Tested with:
az account get-access-token --resource https://vault.azure.net✅az account get-access-token --resource-type arm✅az account get-access-token --scope https://graph.microsoft.com/.default✅DefaultAzureCredential→ Key Vault access ✅