401 Error on a Container App in certain Resource Group
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az containerapp exec Extension Name: containerapp. Version: 0.3.42.
Errors:
The command failed with an unexpected error. Here is the traceback:
Handshake status 401 Unauthorized
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\andejoh06\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 3403, in containerapp_ssh
conn = WebSocketConnection(cmd=cmd, resource_group_name=resource_group_name, name=name, revision=revision,
File "C:\Users\andejoh06\.azure\cliextensions\containerapp\azext_containerapp\_ssh_utils.py", line 62, in __init__
self._socket.connect(self._url, header=[f"Authorization: Bearer {self._token}"])
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\websocket/_core.py", line 253, in connect
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\websocket/_handshake.py", line 57, in handshake
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\websocket/_handshake.py", line 148, in _get_resp_headers
websocket._exceptions.WebSocketBadStatusException: Handshake status 401 Unauthorized
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 containerapp exec -n {} -g {} --container {} --command {}
Expected Behavior
Environment Summary
Windows-10-10.0.26100-SP0
Python 3.10.10
Installer: MSI
azure-cli 2.48.1 *
Extensions:
containerapp 0.3.42
Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0
Additional Context
Thank you for opening this issue, we will look into it.
Getting the same issue. @yonzhan Can you please provide an update on this?
For some further information. I created another full Resource Group including Container App with the same Terraform code, different names and a different Region, this one works fine. I deleted the troublesome Resource Group, recreated it and the error persisted.
Mine has randomly started working again this morning.
It is also working for ne too, Without any change on my end.