Hello Mall Ashi,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you would like to know if there is any downtime involved in enabling autoscaling on the APIM.
Enabling autoscaling in Azure API Management (APIM) is designed to be a seamless process with minimal to no downtime. When you configure autoscaling based on capacity metrics, the system dynamically adjusts the number of units in response to traffic demands, ensuring that your service remains responsive and available.
Downtime Considerations
Generally, there is no significant downtime involved in enabling autoscaling. The scaling operations are handled in the background, and the service continues to operate while the scaling adjustments are made. Secondly, there might be very brief, transient interruptions as new instances are brought online, or existing ones are scaled down, but these are typically negligible and should not impact the overall availability of your service.
Time to Enable Autoscaling
Enabling autoscaling itself is a quick process. Configuring the autoscale settings in the Azure portal or via Azure CLI typically takes just a few minutes. Secondly, the actual time for scaling operations (adding or removing instances) depends on the current load and the scaling rules you have set. Azure handles these operations efficiently to ensure minimal impact on your service.
If you would like to enable Autoscaling, you can do that by:
- Go to your APIM instance in the Azure portal.
- Under the “Scale” section, configure the autoscale settings based on your desired capacity metrics.
- Define the rules for scaling up and down based on metrics such as CPU usage, memory usage, or request count.
But if you would like to configure autoscaling using Azure CLI:
az monitor autoscale create --resource-group <resource-group-name> --resource <apim-name> --resource-type Microsoft.ApiManagement/service --name <autoscale-name> --min-count 1 --max-count 10 --count 2
az monitor autoscale rule create --resource-group <resource-group-name> --autoscale-name <autoscale-name> --condition "Percentage CPU > 70 avg 5m" --scale out 1
az monitor autoscale rule create --resource-group <resource-group-name> --autoscale-name <autoscale-name> --condition "Percentage CPU < 30 avg 5m" --scale in 1
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.