I’m running Linux and I’ve pushed several docker containers up to azure as container instances. My containers seem to be working fine, all services provided by the containers are working. But when I run the az container exec command nothing happens, no error message.
I’m running:
az container exec –subscription mySubscription –resource-group myResource –name myContainer –exec-command "ls"
and then nothing…
When I put in a wrong container name I get an error, so I know that I’m reaching the container. I’m out of ideas about how to see what’s going wrong, I would just say forget it and just do an ssh connection but there doesn’t seem to be a way to do that.
Any help would be appreciated, thanks.
2
Answers
Have you tried launching a bash shell with your container? Try the following command:
az container exec --resource-group myResourceGroup --name myContainer --exec-command "/bin/bash"
Once you’re the bash session is running, simply run the commands you want to:
root@caas-83e6c883014b427f9b277a2bba3b7b5f-708716530-2qv47:/# ls
Check and see if a firewall is blocking port 19390. Opening this port might be a requirement for this command to work, although I cannot confirm this in the Microsoft documentation:
https://learn.microsoft.com/en-us/answers/questions/753676/what-ports-must-be-allowed-in-a-firewall-configura.html