-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az acr run
fails in Azure Pipelines with Azure CLI 2.30.0: Could not retrieve credential from local cache for service principal
#20153
Comments
I’m having the exact same issue when running my workflow in GitHub Actions. A solution will be so helpful as I have bunch of workflow to run. |
Following this issue for a solution, hopefully. |
Facing same issue in Azure/Cli action. |
Just spotted an auto-correct error with my initial message. The command I'm running is |
az acr run
fails: Could not retrieve credential from local cache for service principal
@jiasli for awareness |
az acr run
fails: Could not retrieve credential from local cache for service principalaz acr run
fails in Azure Pipeline with Azure CLI 2.30.0: Could not retrieve credential from local cache for service principal
SymptomAzure Pipeline Azure CLI task fails with
Root causeThe root cause is because Azure CLI task still uses the old ADAL-based Azure CLI After the ADAL to MSAL migration (#19853), the latest Azure CLI We can check the installed Azure CLI on the agent with: # File: azure-pipelines.yaml
resources:
- repo: self
trigger:
batch: true
branches:
include:
- '*'
pr:
branches:
include:
- '*'
jobs:
- job: TestAzureCLITask
displayName: Test Azure CLI Task
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureCLI@2
displayName: Azure CLI
inputs:
azureSubscription: service-connection-test1
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
set -vx
ls ~/.azure
cat ~/.azure/versionCheck.json
cat ~/.azure/accessTokens.json
echo $AZURE_CONFIG_DIR
ls $AZURE_CONFIG_DIR
cat $AZURE_CONFIG_DIR/versionCheck.json
cat $AZURE_CONFIG_DIR/accessTokens.json
az group list
The output shows
Solution
References |
REVERT THIS COMMIT WHEN Azure/azure-cli#20153 IS FIXED
Seeing this issue from Summary:
Steps to reproduce:
What I expected to see:
What I saw instead:
Notes:
Questions:
[0] #20153 (comment) |
Is there a way to translate the ADAL login to MSAL login information (and vice versa)? For a transition period we need to coordinate Agent's upgrade with a tool upgrade. |
Unfortunately, no. ADAL <-> MSAL token migration was finally rejected by the PM team during MSAL migration (#19853). |
az acr run
fails in Azure Pipeline with Azure CLI 2.30.0: Could not retrieve credential from local cache for service principalaz acr run
fails in Azure Pipelines with Azure CLI 2.30.0: Could not retrieve credential from local cache for service principal
Hi,
With version 2.30.0 of the CLI, I'm getting the following error when I run
az acr run
: "ERROR: Could not retrieve credential from local cache for service principal ***. Runaz login
for this service principal."Running
az login
did not help. I'm running the command inside of Azure Pipeline "ubuntu-latest" hosted agent.I already had the following script in my pipeline to workaround a previous issue:
Which was installing version 2.30.0 - the version with the problem.
I modified it such that it installed version 2.29.2, like so:
And it works again.
Please can someone investigate the issue.
The text was updated successfully, but these errors were encountered: