Closed bqstony closed 2 years ago
@bqstony thanks for reporting this issue, it has been added to our backlog.
I have see there is a new version. Now it looks beder 🥳
$ docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock mcr.microsoft.com/iotedge/iotedgedev:3.3.4
iotedgedev@6fac17c8f394:/home/iotedge$ ls -la $HOME/.azure/
total 52
drwxr-xr-x 6 iotedgedev iotedgedev 4096 Mar 31 19:01 .
drwxr-xr-x 1 iotedgedev iotedgedev 4096 Mar 31 19:01 ..
-rw-r--r-- 1 iotedgedev iotedgedev 5 Mar 31 19:01 az.json
-rw-r--r-- 1 iotedgedev iotedgedev 5 Mar 31 19:01 az.sess
-rw-r--r-- 1 iotedgedev iotedgedev 61 Mar 31 19:01 azureProfile.json
drwxr-xr-x 3 iotedgedev iotedgedev 4096 Mar 31 19:01 cliextensions
-rw-r--r-- 1 iotedgedev iotedgedev 58 Mar 31 19:01 commandIndex.json
drwxr-xr-x 2 iotedgedev iotedgedev 4096 Mar 31 19:01 commands
-rw------- 1 iotedgedev iotedgedev 27 Mar 31 19:01 config
drwxr-xr-x 2 iotedgedev iotedgedev 4096 Mar 31 19:01 logs
drwxr-xr-x 2 iotedgedev iotedgedev 4096 Mar 31 19:01 telemetry
-rw-r--r-- 1 iotedgedev iotedgedev 16 Mar 31 19:01 telemetry.txt
-rw-r--r-- 1 iotedgedev iotedgedev 211 Mar 31 19:01 versionCheck.json
Thank you @bqstony for your contributions.
I use the iotedgedev container in a jenkins pipeline. Lucky for me the container contains already the azure CLI. When i start the container, the user
iotedgedev
. But the $HOME/.azure/ directory is partial owned by the root, insteed of the iotedgedev. This results in the errorPermissionError: [Errno 13] Permission denied: '/home/iotedgedev/.azure/msal_http_cache.bin'
The Problem is also descriped in this issue: https://github.com/Azure/azure-cli/issues/14151
Steps to Reproduce:
docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock
az login --service-principal --allow-no-subscriptions --username xxx --password xxx
az acr check-health -n someregistry.azurecr.io --yes
sudo az login --service-principal --allow-no-subscriptions --username xxx --password xxx
az acr check-health -n someregistry.azurecr.io --yes
The result is:
here are the permissons of the config folder: iotedgedev@988bc802348e:/home/iotedge$ ls -la $HOME/.azure/ total 92 drwxr-xr-x 1 iotedgedev iotedgedev 4096 Apr 1 12:49 . drwxr-xr-x 1 iotedgedev iotedgedev 4096 Mar 7 22:25 .. -rw-r--r-- 1 iotedgedev iotedgedev 5 Mar 7 22:25 az.json -rw-r--r-- 1 iotedgedev iotedgedev 5 Apr 1 12:49 az.sess -rw-r--r-- 1 iotedgedev iotedgedev 467 Apr 1 12:49 azureProfile.json drwxr-xr-x 3 iotedgedev iotedgedev 4096 Mar 7 22:25 cliextensions -rw-r--r-- 1 root root 66 Apr 1 12:49 clouds.config -rw-r--r-- 1 iotedgedev iotedgedev 5408 Apr 1 12:49 commandIndex.json drwxr-xr-x 1 iotedgedev iotedgedev 4096 Apr 1 12:49 commands -rw------- 1 iotedgedev iotedgedev 27 Mar 7 22:25 config drwxr-xr-x 1 iotedgedev iotedgedev 4096 Mar 7 22:25 logs -rw-r--r-- 1 root root 5505 Apr 1 12:49 msal_http_cache.bin -rw-r--r-- 1 root root 2281 Apr 1 12:49 msal_token_cache.json -rw-r--r-- 1 root root 196 Apr 1 12:49 service_principal_entries.json drwxr-xr-x 1 iotedgedev iotedgedev 4096 Mar 7 22:25 telemetry -rw-r--r-- 1 iotedgedev iotedgedev 16 Apr 1 12:49 telemetry.txt -rw-r--r-- 1 iotedgedev iotedgedev 211 Mar 7 22:25 versionCheck.json
Workaround My actual fix is to run the
sudo chown -R iotedgedev .azure/
command,