Skip to content

Commit

Permalink
Remove scale rules that result in always 1 replica
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Oct 9, 2023
1 parent b39bdf0 commit 6038e66
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
24 changes: 0 additions & 24 deletions main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -205,30 +205,6 @@ resource app 'Microsoft.App/containerApps@2023-05-01' = {
]
}
]
scale: {
minReplicas: 0
maxReplicas: 2
rules: [
{ name: 'http', http: { metadata: { concurrentRequests: '1000' } } }
{
name: 'cleanup-queue'
azureQueue: eventBusTransport == 'QueueStorage' ? {
queueName: 'azdo-cleanup'
queueLength: 100
auth: [ { secretRef: 'connection-strings-asb-scaler' } ]
} : null
custom: eventBusTransport == 'ServiceBus' ? {
type: 'azure-servicebus'
metadata: {
namespace: hasProvidedServiceBusNamespace ? providedServiceBusNamespace.name : serviceBusNamespace.name // Name of the Azure Service Bus namespace that contains your queue or topic.
queueName: 'azdo-cleanup' // Name of the Azure Service Bus queue to scale on.
messageCount: '100' // Amount of active messages in your Azure Service Bus queue or topic to scale on.
}
auth: [ { secretRef: 'connection-strings-storage-scaler', triggerParameter: 'connection' } ]
} : null
}
]
}
}
}
identity: {
Expand Down
21 changes: 1 addition & 20 deletions main.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,7 @@
}
]
}
],
"scale": {
"minReplicas": 0,
"maxReplicas": 2,
"rules": [
{
"name": "http",
"http": {
"metadata": {
"concurrentRequests": "1000"
}
}
},
{
"name": "cleanup-queue",
"azureQueue": "[if(equals(parameters('eventBusTransport'), 'QueueStorage'), createObject('queueName', 'azdo-cleanup', 'queueLength', 100, 'auth', createArray(createObject('secretRef', 'connection-strings-asb-scaler'))), null())]",
"custom": "[if(equals(parameters('eventBusTransport'), 'ServiceBus'), createObject('type', 'azure-servicebus', 'metadata', createObject('namespace', if(variables('hasProvidedServiceBusNamespace'), split(parameters('serviceBusNamespaceId'), '/')[8], format('{0}-{1}', parameters('name'), variables('collisionSuffix'))), 'queueName', 'azdo-cleanup', 'messageCount', '100'), 'auth', createArray(createObject('secretRef', 'connection-strings-storage-scaler', 'triggerParameter', 'connection'))), null())]"
}
]
}
]
}
},
"identity": {
Expand Down

0 comments on commit 6038e66

Please sign in to comment.