Azure / Azure/azure-cli

Export of container with no identity fails

Open
#18,395 2 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Container Instances Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Describe the bug
When I try to export an ACI group, it gives me an error. Looks like it is connected with the identity.
There is no identity associated with this ACI. As soon as I create a system managed identity with it, the command passes.
When I remove the identity, the command fails again.

**Command Name**
`az container export`

**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
('cannot represent an object', )
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/container/custom.py", line 601, in container_export
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/__init__.py", line 306, in safe_dump
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/__init__.py", line 278, in dump_all
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 27, in represent
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 48, in represent_data
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 207, in represent_dict
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 118, in represent_mapping
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 58, in represent_data
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/representer.py", line 231, in represent_undefined
yaml.representer.RepresenterError: ('cannot represent an object', )

```

## To Reproduce:
Steps to reproduce the behavior.

- Create an ACI container group
- Do not assign any identity with it
- Run the export command `az container export -g {group-name} -n {aci-name} -f {file-name} --debug`

## Expected Behavior
Export command should work without issues.

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

azure-cli 2.24.2

```
## 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.