The image tag is commented out, I am trying to pass it as an argument
to the create command. This is the error
(ContainerAppImageRequired) Container with name 'sample-dotnet' must have an '```
'Image' property specified
If you pass the configuration using yaml
while you creating container app using Az Cli
Path to a .yaml
file with the configuration of a container app and remaining all other parameters will be ignored. check the MS Doc for your reference.
To resolve the issue, kindly pass the all configuration except container app name and resource group name
Azure Cli Command to create container app.
az containerapp create -n mywebapp -g Sri --yaml "C:\Users\user\configuration.yml"
Configuration.yml
location: "West US 2"
type: Microsoft.App/containerApps
properties:
managedEnvironmentId: /subscriptions/7195d375-7af2-43f1-bd66-12e77ac05818/resourceGroups/Sri/providers/Microsoft.App/managedEnvironments/managedEnvironment-Sri-b57d
configuration:
secrets:
- name: myregistrypassword
value: xxxxxxxxxxKPzkmJIXiTn/MCKkvNAL+ACRCDlME+
registries:
- passwordSecretRef: myregistrypassword
server: vnfhfhf.azurecr.io
username: venkattest
template:
containers:
- image: venkattest.fnfnf .io/mywebapp:v1
name: mywebapp
Output:

Once I ran the above commands, the container app is successfully created in the portal as shown below.

Refer Create a container app using a YAML configuration and check example YAML configuration