Azure / Azure/azure-cli

Cannot get deployment logs from Azure using python module azure.cli

Open
#18,911 3 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad feature-request Packaging
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## I am trying to retrieve deployment center logs for an app service in Azure using python and the azure.cli library. Other commands like `az group list` work just fine but this one seems to be returning an error. I've tried using pip to uninstall and reinstall the module 'nacl' that appears to be missing, but pip could neither find it on my system for uninstalling, nor could it find a version online.

**Command Name**
`az webapp log deployment list`

**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
No module named 'nacl._sodium'
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\knack\cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\core\commands\__init__.py", line 556, in execute
self.commands_loader.load_arguments(command)
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\core\__init__.py", line 517, in load_arguments
self.command_table[command].load_arguments() # this loads the arguments via reflection
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\core\commands\__init__.py", line 313, in load_arguments
super(AzCliCommand, self).load_arguments()
File "C:\Python39\lib\site-packages\knack\commands.py", line 104, in load_arguments
cmd_args = self.arguments_loader()
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\core\commands\command_operation.py", line 125, in arguments_loader
op = self.get_op_handler(self.op_path)
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\core\commands\command_operation.py", line 59, in get_op_handler
handler = import_module(mod_to_import)
File "C:\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users\kreet\AppData\Roaming\Python\Python39\site-packages\azure\cli\command_modules\appservice\custom.py", line 22, in
from nacl import encoding, public
File "C:\Users\kreet\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\nacl\public.py", line 17, in
import nacl.bindings
File "C:\Users\kreet\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\nacl\bindings\__init__.py", line 17, in
from nacl.bindings.crypto_aead import (
File "C:\Users\kreet\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\nacl\bindings\crypto_aead.py", line 18, in
from nacl._sodium import ffi, lib
ModuleNotFoundError: No module named 'nacl._sodium'

```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- _Put any pre-requisite steps here..._
- `az webapp log deployment list --name {} --resource-group {}`

## Expected Behavior

## Environment Summary
```
Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.26.0 *

```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.