question

scal avatar image
0 Votes"
scal asked prmanhas-MSFT answered

How to run a bash command in a running instance

Dear all,

I have deploy in Azure container instance an Atlassian Jira image which gets sucessfully uploaded and deployed.
But I have some trouble to access the URL.

Due to that I need to access some of the configuration file in the file system of the application by using bash commands.

It Docker it works correctly by running the command as from powershell:

docker exec -i -t --user root <container ID> /bin/bash

When I try to run the same command, as explain from the original documentation below :
https://docs.microsoft.com/en-us/azure/container-instances/container-instances-exec

Then I get the following wierd error when executing the below command:

Command :
az container exec --resource-group TESTCONTAINERS --name jira-tasks --exec-command "/bin/bash" --container-name jira-tasks

Error :
The command failed with an unexpected error. Here is the traceback:
'ContainerInstanceManagementClient' object has no attribute 'container'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 657, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 720, in run_jobs_serially
results.append(self.run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/
init
.py", line 691, in run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/
init.py", line 328, in call_
return self.handler(args, kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(
*command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py", line 609, in container_exec
container_client = cf_container(cmd.cli_ctx)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/_client_factory.py", line 18, in cf_container
return _container_instance_client_factory(cli_ctx).container
AttributeError: 'ContainerInstanceManagementClient' object has no attribute 'container'

Any idea what is wrong and how can I access to the file system of my deployed image to check some configuration file ?

Thanks for your reply
regards

![AttributeError][1]: 'ContainerInstanceManagementClient' object has no attribute 'container'






azure-container-instances
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

prmanhas-MSFT avatar image
0 Votes"
prmanhas-MSFT answered

@scal Apologies for the delay in response and all the inconvenience caused because of the issue!!!

Similar issue has been reported here users reported similar issue with Az CLI 2.28.0 where changing CLI to previous version helped customer out. Also as per latest update same is working fine on 2.29.0 so can you please check the same in your environment and see if you have similar case.

Also this issue is more around Azure CLI even though Containers are in picture so if the issue still persist I would request you to open your issue on our Git repository here. If you need help on this let me know I will open one for you.

Hope it helps!!!

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.