Question:
You have deployed a container using the following YAML configuration:
apiVersion: 2018-10-01
location: eastus
name: securetest
properties:
containers:
- name: mycontainer
properties:
environmentVariables:
- name: 'EXPOSED'
value: 'my-exposed-value'
- name: 'SECRET'
secureValue: 'my-secret-value'
osType: Linux
restartPolicy: Always
tags: null
type: Microsoft.ContainerInstance/containerGroups
You want to retrieve the value of the environment variable "SECRET" using the Azure CLI and execute the following command:
az container show --resource-group myResourceGroup --name securetest --query "properties.containers[0].properties.environmentVariables[?name=='SECRET']"
What should you expect from this command?
Answer:
The given YAML configuration demonstrates how to set a secure environment variable named "SECRET" with the secureValue property. When viewing container properties through the Azure portal or Azure CLI, only the secure variable's name is displayed, not its value. Therefore, executing the given command will show the name of the secure variable "SECRET", but not its actual value.