Azure / Azure/azure-cli

Weird behaviour when using `az containerapp` command with `--yaml` flag

Open
#27,477 2 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Auto-Assign bug ContainerApp customer-reported Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

When using `az containerapp create --yaml ` command it returns:
`
the following arguments are required: --name/-n, --resource-group/-g
`

Then when the arguments are given in the command it says:
`
Additional flags were passed along with --yaml. These flags will be ignored, and the configuration defined in the yaml will be used instead
`

This sound like a bug to me a i would imagine it should read the resourceGroup and the name from the yaml also without having to define those arguments separately to create command.

Also other thing that when the name inside the yaml file differs from the one that is given to az command it outputs:
`
The app name provided in the --yaml file "mycontainerapp" does not match the one provided in the --name flag "test-ca". The one provided in the --yaml file will be used.
`

But in the end the one that was given with the flag gets used regardless what the output says.

### Related command

`az containerapp create --yaml`

Make sure the -n flag differs from the one defined in the yaml file.
`az containerapp create -n -g --yaml`

### Errors

-

### Issue script & Debug output

-

### Expected behavior

I would expect that when `az containerapp create --yaml ` command is run it could read all the settings there without having to pass any additional flags to command. Also if i would pass the additional flags it should then use the values from the yaml file as the output states from the command

### Environment Summary

azure-cli 2.53.0

core 2.53.0
telemetry 1.1.0

Extensions:
containerapp 0.3.41

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.