Skip to content
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

ai-exp6 - knack.util.CLIError: Could not retrieve credential from local cache for service principal ***. Run az login for this service principal. #48

Closed
krisbock opened this issue Jan 6, 2022 · 1 comment

Comments

@krisbock
Copy link

krisbock commented Jan 6, 2022

Task 2: Run the Build Pipeline fails in 'Get or create AML Compute Target' step with:

2022-01-06T05:53:56.435590] Logging experiment finalizing status in history service.
Starting the daemon thread to refresh tokens in background for process with pid = 3694
Cleaning up all outstanding Run operations, waiting 300.0 seconds
1 items cleaning up...
Cleanup took 0.1008906364440918 seconds
Traceback (most recent call last):
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azureml/core/authentication.py", line 2283, in _get_arm_token_with_refresh
access_token = profile_object.get_raw_token(resource=resource)[0][1]
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 383, in get_raw_token
credential = self._create_credential(account, tenant)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 597, in _create_credential
return identity.get_service_principal_credential(username_or_sp_id)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 236, in get_service_principal_credential
entry = self._service_principal_store.load_entry(client_id, self.tenant_id)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 320, in load_entry
.format(sp_id))
knack.util.CLIError: Could not retrieve credential from local cache for service principal ***. Run az login for this service principal.

Error from AML driver log:
n create_aml_cluster.py
Azure ML SDK version: 1.37.0
Argument 1: gpucluster
Argument 2: /home/vsts/work/1/s
creating AzureCliAuthentication...
done creating AzureCliAuthentication!
get workspace...

[2022-01-06T05:53:56.425879] The experiment failed. Finalizing run...
[2022-01-06T05:53:56.425904] Start FinalizingInRunHistory
[2022-01-06T05:53:56.435590] Logging experiment finalizing status in history service.
Starting the daemon thread to refresh tokens in background for process with pid = 3694
Cleaning up all outstanding Run operations, waiting 300.0 seconds
1 items cleaning up...
Cleanup took 0.1008906364440918 seconds
Traceback (most recent call last):
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azureml/core/authentication.py", line 2283, in _get_arm_token_with_refresh
access_token = profile_object.get_raw_token(resource=resource)[0][1]
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 383, in get_raw_token
credential = self._create_credential(account, tenant)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 597, in _create_credential
return identity.get_service_principal_credential(username_or_sp_id)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 236, in get_service_principal_credential
entry = self._service_principal_store.load_entry(client_id, self.tenant_id)
File "/home/vsts/.azureml/envs/azureml_b54a7a69e83d04a100a32a3a44b87b62/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 320, in load_entry
.format(sp_id))
knack.util.CLIError: Could not retrieve credential from local cache for service principal XXXXXXXXXXXXX. Run az login for this service principal.

Looks like the error is caused by breaking changing in azcli with tokens: Azure/cli#56

@krisbock
Copy link
Author

krisbock commented Jan 6, 2022

Looks like a number of PRs have been issued for the source repo which needs the CLI version updated: solliancenet/mcw-mlops-starter#3

i.e. updating environment_setup/install_requirements.sh to
python --version
pip install azure-cli==2.32.0
pip install azureml-sdk==1.37.0
pip install azureml-dataprep[pandas]

@krisbock krisbock closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant