0

I am using this to create a azure container app

az containerapp create -n sample -g my-container-app-env --image sampleapi-docker-build.domainname/sample-dotnet:2.0.2989 --yaml ./configuration.yml

In my configuration.yml file

template:
containers:
  - name: sample-dotnet
    #image: sampleapi-docker-verify.domain/sample-dotnet:2.0.2989
    resources:
      cpu: 0.25
      memory: .5Gi

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.

How do I supply some arguments in create command and others in the yaml configuration file??

Jody
  • 323
  • 2
  • 11

1 Answers1

0

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:

enter image description here

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

enter image description here

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

Venkat V
  • 2,197
  • 1
  • 1
  • 10