ContainerApps@2022-03-01 cannot handle conditional registries
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Bicep version**
Bicep CLI version 0.8.9 (33a85174de)
and Bicep CLI version 0.9.1 (a2950a16df)
**Describe the bug**
I'm able to deploy a bicep file that creates a ContainerApp with a registry specified. However when I [make the registry property conditional](https://github.com/Gordonby/azure-quickstart-templates/blob/gb-containerAppRegistryIssue/quickstarts/microsoft.app/container-app-acr/main.bicep#L117), I get this error;
> "code": "ContainerAppInvalidSchema", "message": "Invalid request body for container app. Does not conform to Container App schema"
works;
```bicep
registries: [
{
identity: uai.id
server: acr.outputs.loginServer
}
]
```
also works;
```bicep
registries: []
```
causes the weird error;
```bicep
registries: someBooleanVar ? [] : [
{
identity: uai.id
server: acr.outputs.loginServer
}
]
```
Quite frustrating....
**To Reproduce**
Reproduceable from branch https://github.com/Gordonby/azure-quickstart-templates/blob/gb-containerAppRegistryIssue/quickstarts/microsoft.app/container-app-acr/main.bicep#L117
```bash
cd quickstarts\microsoft.app\container-app-acr
az group create -n innerloopeastus -l eastus
az deployment group create -g innerloopeastus -f .\main.bicep
```
Contributor guide
Research direction
Reproduce the issue from quickstarts/microsoft.app/container-app-acr/main.bicep around line 117 using the listed az group create and az deployment group create commands. Compare the concrete registries array, empty array, and conditional form; done means the conditional form deploys without the ContainerAppInvalidSchema error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100