0

Having a hard time finding any docs or commands in the CLI to get a list of all running ACI containers I have in a resource group. Is it possible?

My scenario is to spin up about 100 instances to scale-out work, but when the work is finished, the container terminates (no auto restart). When the work is 100% complete, I want to delete all the groups... but I can't figure out how to get a list of all and the different states.

Ideas?

Andrew Connell
  • 4,939
  • 5
  • 30
  • 42

1 Answers1

1

To list the containers' state inside a container group, you can just show the details of the container group, all the information in the output. Then you need to filter the info as you need.

Just output the containers' name and state in the container group via CLI:

az container show -g yourResourceGroup -n yourContainerGroup --query "containers[*].{Name: name, State: instanceView.currentState.state}"

The screenshot of the output:

enter image description here

Charles Xu
  • 29,862
  • 2
  • 22
  • 39