Search code examples
azurepowershellazure-container-apps

Update Azure Container app scaling rule with PowerShell


I need to update the scaling rule of an Azure container app with PowerShell. The provided examples on the MSDN documentation is not super helpful. From the Azure portal this is what I need to do, enter image description here

What should be the PowerShell command to update the container app?


Solution

  • Suppose you wanted to set the concurrent requests to 5 for the HTTP scaling rule named "test-rule":

    Here's how to do it:

    $scaleRuleObject = New-AzContainerAppScaleRuleObject -Name "test-rule" -CustomType "http" -CustomMetadata @{"concurrentRequests"="5"}
    Update-AzContainerApp -ContainerAppName demoapp -ResourceGroupName demoapp-rg -ScaleRule $scaleRuleObject