QuestionQ80

DevSecOps Pipeline-Operate and Monitor Stage

Erica Mena works as a DevSecOps engineer at an IT company that delivers customized software solutions to clients across the United States. To protect serverless and container applications using RASP, she wants to create an Azure container instance via Azure CLI in Microsoft PowerShell. She created the Azure container instance, loaded the container image into it, and then reviewed the deployment of the container instance.

Assuming the resource group name is ACI and the container name is aci-test-closh, which command should Erica run to retrieve the logging information from the Azure container instance?

  • A az container logs -resource-group ACI -name aci-test-closh
  • B az get container logs --resource-group ACI --name aci-test-closh
  • C az container logs --resource-group ACI --name aci-test-closh
  • D az get container logs -resource-group ACI --name aci-test-closh
Explanation

Azure CLI uses the 'az container logs' command to fetch the logs of a container within an Azure Container Instance, and it requires the long-form parameter flags with double dashes: '--resource-group' and '--name'. The command 'az get container logs' is not a valid Azure CLI command, and single-dash usage for multi-word parameters like '-resource-group' is invalid syntax in Azure CLI. Therefore, the correctly formed command is 'az container logs --resource-group ACI --name aci-test-closh', which retrieves the standard output/error logs generated by the container's running processes.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!