Azure / Azure/bicep-registry-modules
[AVM Module Issue]: Unable to create a cognitive services account with multiple deployments
- Dominant language
- Bicep
- Stars
- 736
- Forks
- 564
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 30
Description
### Check for previous/existing GitHub issues
- [x] I have checked for previous/existing GitHub issues
### Issue Type?
Bug
### Module Name
avm/res/cognitive-services/account
### (Optional) Module Version
0.10.1
### Description
According to this [parameter description](https://github.com/Azure/bicep-registry-modules/blob/3385341b7cdd437703e65ace083ac5b86be990ce/avm/res/cognitive-services/account/main.bicep#L129), the deployments parameter should be an array and looking at [this](https://github.com/Azure/bicep-registry-modules/blob/3385341b7cdd437703e65ace083ac5b86be990ce/avm/res/cognitive-services/account/main.bicep#L359) bicep code, it seems that it _should_ work fine if I set my deployments array up like this.
```
deployments: [
{
model: {
name: 'gpt-35-turbo'
format: 'OpenAI'
version: '0125'
}
sku: {
name: 'Standard'
capacity: 8
}
}
{
model: {
name: 'dall-e-3'
format: 'OpenAI'
version: '3.0'
}
sku: {
name: 'Standard'
capacity: 1
}
}
]
```
But it does not work and get the following error message:
```
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription:
Deployment Error Details:
InvalidTemplate: Deployment template validation failed: 'The resource 'Microsoft.CognitiveServices/accounts/aoai-devdtzp/deployments/aoai-devdtzp-deployments' at line '1' and column '34876' is defined multiple times in a template. Please see https://aka.ms/arm-syntax-resources for usage details.'.
```
If I remove my `dall-e-3` deployment from the array, then it works fine.
### (Optional) Correlation Id
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.