How to properly use the resources: [] element? #2838
-
Currently I am referencing dependents via its name, which works just fine.
However, when looking at the ARM reference/documentation, e.g. for Postgres server the template contains a property called
The documentation further says it can take values of e.g.
Is this a bug? What am I doing wrong here? Thanks in advance! Resource reference
Empty array
ARM/JSON Style
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We have a slightly different syntax for expressing child resources, which is what the resource psql 'Microsoft.DBForPostgreSQL/servers@2017-12-01' = {
// ...
resources db 'databases' = {
name: 'mydatabase'
properties: {
charset: 'UTF8'
collation: 'English_United States.1252'
}
}
} Notice we inherit the parent type and apiVersion. You can override the apiVersion if you need to (i.e. More info here: https://github.com/Azure/bicep/blob/main/docs/spec/resources.md#resource-nesting |
Beta Was this translation helpful? Give feedback.
We have a slightly different syntax for expressing child resources, which is what the
resources
property is for in ARM JSON. Instead of using this property, you declare the resource just like a top level resource. In this case:Notice we inherit the parent type and apiVersion. You can override the apiVersion if you need to (i.e.
'databases@2021-01-01'
)More info here: https://github.com/Azure/bicep/blob/main/docs/spec/resources.md#resource-nesting