f04f9db310 | ||
---|---|---|
.. | ||
MessageCount.ps1 | ||
Readme.md | ||
Simulate-Feed-Requests.ps1 | ||
feeds.json | ||
scale-out-demo-0.png | ||
scale-out-demo-1.png | ||
scale-out-demo-2.png |
Readme.md
Azure Container Apps
This folder contains additional scripts needed for testing the Azure Container Apps scenario.
You must first enable the feeds injestion API by turning it on in the api.deployment.json
file on line 64.
"deployIngestion": true
Demo steps:
-
Get the HTTP API application details:
az containerapp show -g "$RESOURCE_GROUP_NAME" -n podcastapi
-
Look for the application's address in the
fqdn
field in theingress
config section:"configuration": { "ingress": { "external": true, "fqdn": "<FQDN>", "targetPort": 80, "transport": "auto" },
-
Browse the HTTP API to confirm It works.
https://<FQDN>
-
Open a PowerShell terminal and watch Container Apps:
-
podcastingestionca
: Worker service that scale based on queue messages. When the queue is empty the container app should have 1 instances.scale: { maxReplicas: 5 minReplicas: 1 rules: [ { name: 'queue-scaling-rule' azureQueue: { queueName: 'feed-queue' queueLength: 20 auth: [ { secretRef: 'feedqueue' triggerParameter: 'connection' } ] } } ] }
-
podcastapica
: HTTP API that scale based on concurrent HTTP requests. When there are no incoming requests the container app should have 0 instances.scale: { minReplicas: 0 maxReplicas: 5 rules: [ { name: 'httpscalingrule' http: { metadata: { concurrentRequests: '20' } } } ] }
4.1 Run this commands to watch container apps scaling out.
while (1) { $output = az containerapp revision list -n podcastapica -g dotnetconf2021-netpodcast --query "[?active].{Name:name, CreatedTime:createdTime, Active:active, Replicas:replicas}" -o table --only-show-errors clear; echo $output; sleep 2; }
while (1) { $output = az containerapp revision list -n podcastingestionca -g dotnetconf2021-netpodcast --query "[?active].{Name:name, CreatedTime:createdTime, Active:active, Replicas:replicas}" -o table --only-show-errors clear; echo $output; sleep 2; }
while (1) { $output = ./MessageCount.ps1 -storageAccount <storageAccountName> -accessKey <accessKey> clear; echo $output; sleep 1; }