In Bicep, how can I define a property on a resource only if it matches a condition? For instance if I want to create an Azure Service Bus Standard Tier in my non-prod environment, then in it certain properties like “capacity” and “zoneRedundant” are not allowed properties, but they are allowed if I want to create a Premium Tier in my prod env.
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-10-01-preview' = {
name: serviceBusNamespaceName
location: location
sku: {
name: (environmentName == 'prod') ? 'Premium' : 'Standard'
//capacity: 1
}
identity: {
type: 'SystemAssigned'
}
properties: {
//zoneRedundant: (environmentName == 'prod') ? true : false
disableLocalAuth: true
}
}