Fix Docker: resolve permission denied and libsecret persistence failure#1977
Draft
g2vinay wants to merge 1 commit intomicrosoft:mainfrom
Draft
Fix Docker: resolve permission denied and libsecret persistence failure#1977g2vinay wants to merge 1 commit intomicrosoft:mainfrom
g2vinay wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Two issues affecting Docker users:
1. The azmcp binary in /mcp-server/ lacked execute permission because only
the renamed server-binary was chmod'd. Any direct invocation of ./azmcp
(custom entrypoints, workaround configs) hit 'permission denied'.
Fix: chmod both server-binary and \.
2. InteractiveBrowserCredential's MSAL token-cache persistence requires
libsecret, which was absent from the Alpine base image. This caused
'Persistence check failed / libsecret-1.so.0 not found' errors even
when valid service-principal credentials were supplied via env vars,
because the MsalCachePersistenceException propagated as an unhandled
exception rather than CredentialUnavailableException, killing the chain.
Fixes:
- Install libsecret in the Dockerfile so persistence works when a
keyring daemon is available.
- Wrap CreateBrowserCredential in SafeTokenCredential so any remaining
persistence failure gracefully falls through the credential chain
instead of surfacing as an unhandled AuthenticationFailedException.
Adds a Docker section to docs/Authentication.md explaining that
AZURE_TOKEN_CREDENTIALS=prod must be set when running in a container to
avoid interactive-credential fallback and the libsecret dependency.
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.
Fixes two issues affecting Docker users:
Permission denied on ./azmcp — only the renamed server-binary was made executable; the original binary was not. Added it to the chmod so it can be invoked directly.
Authentication fails with "Persistence check failed / libsecret not found" — the Alpine image was missing libsecret, causing MSAL's token-cache initialization to throw a hard exception that bypassed the entire credential chain — even when valid service principal credentials were set. Fixed by installing libsecret in the image and wrapping InteractiveBrowserCredential in SafeTokenCredential so any persistence failure falls through gracefully instead of crashing.
Also adds a Docker section to Authentication.md recommending AZURE_TOKEN_CREDENTIALS=prod for container deployments to skip interactive credentials entirely.