I'm trying to create a bicep file for an application that uses RabbitMQ. However, the RabbitMQ container app throws an error when I try to create a queue or an exchange. I'm able to create a queue and add messages with a Python script, but when I try to open the queue on the web, it says it doesn't exist.
I belive the error is thanks to the %2F on the url of rabbitmq, but I´m not sure.
Bicep file:
resource vnet 'Microsoft.Network/virtualNetworks@2023-06-01' = {
name: '${prefix}-vnet'
location: location
properties: {
addressSpace: {
addressPrefixes: ['10.2.0.0/16']
}
encryption: {
enabled: false
enforcement: 'AllowUnencrypted'
}
virtualNetworkPeerings: []
enableDdosProtection: false
}
}
resource Subnet_rabbitmq 'Microsoft.Network/virtualNetworks/subnets@2023-06-01' = {
parent: vnet
name: 'subnet-rabbitmq'
properties: {
addressPrefix: '10.2.2.0/23'
// networkSecurityGroup: {
// id: networkSecurityGroup.id
// }
serviceEndpoints: []
// delegations: [
// {
// name: 'Microsoft.App.environments'
// properties: {
// serviceName: 'Microsoft.App/environments'
// }
// type: 'Microsoft.Network/virtualNetworks/subnets/delegations'
// }
// ]
privateEndpointNetworkPolicies: 'Disabled'
privateLinkServiceNetworkPolicies: 'Enabled'
}
}
resource managedEnvironment 'Microsoft.App/managedEnvironments@2022-03-01' = {
name: 'env-${prefix}'
location: location
properties: {
daprAIInstrumentationKey:appInsights.properties.InstrumentationKey
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: logAnalyticsWorkspace.properties.customerId
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey
}
}
// vnetConfiguration:{
// infrastructureSubnetId: resourceId('Microsoft.Network/virtualNetworks/subnets', vnet.name, 'rabbitmq')
// }
vnetConfiguration: {
internal: false
infrastructureSubnetId: Subnet_rabbitmq.id
}
}
}
resource containerAppRabbitmq 'Microsoft.App/containerapps@2023-08-01-preview' ={
name: 'ca-${prefix}-rabbitmq'
location: location
properties:{
managedEnvironmentId: managedEnvironment.id
environmentId: managedEnvironment.id
// workloadProfileName: 'Consumption'
configuration: {
secrets: [
{
name: 'containerregistrypasswordref'
value: 'password'
}
]
activeRevisionsMode: 'Single'
ingress: {
external: true
targetPort: 15672
exposedPort: 0
transport: 'Auto'
traffic: [
{
weight: 100
latestRevision: true
}
]
allowInsecure: true
clientCertificateMode: 'Ignore'
stickySessions: {
affinity: 'none'
}
additionalPortMappings: [
{
external: true
targetPort: 5672
exposedPort: 5672
}
]
}
registries: [
{
// server is in the format of myregistry.azurecr.io
server: '{acr-url}'
username: 'test-bicep'
passwordSecretRef: 'containerregistrypasswordref'
}
]
}
template: {
containers: [
{
image: '{acr-url}/external/rabbitmq:3.11-management'
name: 'rabbitmq-3-11-management'
}
]
}
}
}