I'm creating a bicep module like this:
param permission object
var keys = [for key in permission.keys: key]
var secretes= [for secret in permission.secrets: secret]
var certificates = [for certificate in permission.certificates: certificate]
where "permissions" is an object containing these 3 arrays.
This works nicely, but I would prefer something like this (one complex variable instead of 3 separate arrays):
var x = {
keys: [for key in permission.keys: key]
secrets: [for secret in permission.secrets: secret]
certificates: [for certificate in permission.certificates: certificate]
}
Syntactically this is not permitted. Interestingly, when doing the same thing within a resource definition, the same syntax is valid, e.g.:
resource EventHubAuthorization 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@2021-01-01-preview' = {
name: '${EventHub.name}/${AuthorizationName}'
properties: {
rights: [for right in Rights: right]
}
}
Is this simply how things are or am I missing something and what I want could be done - just differently?
br volker