Deploy autoscale rules for app service plan using az cli.
How to deploy autoscale rules for app plans in resource group. Using for each
Az monitor autoscale.
Can anyone help me the logic for each for app service autoscale .
How to Deploy rules for multiple app plans in one environment.using az cli commands with "For each loop
"
Can anyone provide for each logic and
Define scale rules
Related
I am trying to add an autoscale rule to my app webapp, where I need to scale up 1 instance based on the number of messages from a service bus queue (metric source). I am hoping if someone has insight on how this can be achieved using Azure CLI. The microsoft documentation on autoscale doesn't really cover how I can add metric source as part of the condition.
From the UI:
[Metric Scale option from UI]
I am trying to to achieve something similar to this:
az monitor autoscale rule create --resource-group MyResourceGroup --resource MyPlan
--resource-type 'Microsoft.Web/serverfarms' --autoscale-name MyAutoScale
--condition "MessageCount > 20 avg 5m" `
--scale out 2
Looking at the json file, I am trying to get specify these fields in Azure cli
Any help on this topic would be highly apprciated. Thank you.
while creating the az monitor autoscale rule you have to specify the valid --condition to process your metrics.
Check the supported Metrics to achieve this.
Refer Service bus metrics to process the autoscale.
I want to automate mapping a custom domain for my web app's deployment slots(not the production slot). I have achieved this through the Azure Portal with this guide, but I can't get it to work through the AZ CLI. It appears that in the cli, only through for the production slot is possible to achieve mapping a custom domain. This is the command to do it for the production slot but I can not see an option for other slots on the same web app. Also whatever I try on the webapp-name parameter to try and reference the slot(as supposingly is a separate web app) doesn't work(it keeps giving me app not found errors):
az webapp config hostname add --webapp-name <app_slot_name> --resource-group <rg> --hostname <cname_that_already_exists>
You can use --slot.
Offical doc.
az webapp config hostname add
az webapp config hostname add [--hostname]
[--ids]
[--resource-group]
[--slot]
[--subscription]
[--webapp-name]
I am trying to experiment with Preview feature available in Azure AKS as per documentation available we need to have the following requirements
Kubernetes version 1.12.4 or later
Azure CLI version 2.0.55 or later.
add aks preview :- az extension add --name aks-preview
register scale set provider:- az feature register --name VMSSPreview --namespace Microsoft.ContainerService
ensure that it is registerd
created AKS cluster with terraform
when i try to apply following command
az aks update --resource-group rg-euwest-d04-dvag-001 --name k8s-euwest-d04-dvag-dfs-dfsapp-001 --enable-cluster-autoscaler --min-count 3 --max-count 5
error
Operation failed with status: 'Bad Request'. Details: AgentPool
'' has set auto scaling as enabled but is not on Virtual
Machine Scale Sets, this is not allowed
As per my understanding, it is not supported at this time through terraform or from Azure Portal but only possible from Azure CLI
Your cluster needs to be created via Azure CLI to enable autoscaling. So if you have created on evia Azure portal, you need to delete it and create new one through Azure CLI. Ref: https://github.com/MicrosoftDocs/azure-docs/issues/29199
I have a PowerShell script which creates an azure function app on a consumption plan and its associated storage account within a resource group using the azure cli following the example In the Microsoft Docs
However to enable application insights I have to go to the azure portal, find the func select monitor and click enable application insights.
How can I expand that script to enable automate this step for the newly created function? I have been unable to find any specific documentation or examples and I would prefer to avoid resource templates if possible.
OF course, you could enable Application Insights to the azure function by Azure CLI.
But you need to create the Application Insights in the portal first, currently, it is unable to create Application Insights via Azure CLI.
You could follow the steps below.
1.Go to your Application Insights in the portal, copy the Instrumentation Key in the screenshot.
2.After creating the function app by your command , just use the CLI command below.
az functionapp config appsettings set --name <functionname> --resource-group <resourcegroupname> --settings 'APPINSIGHTS_INSTRUMENTATIONKEY = <Instrumentation Key>'
It works fine on my side, you could check it in the portal.
I have a lot of classic Azure services with classic VMs some have auto scale setting and some don't. Is there a way through powershell I can find out if a classic Azure services has AutoScale set or not. looking at Get-AzureService and Get-AzureVM does not seem to have this information
For now, classic service display in ARM resource group, so we can use this command Get-AzureRmAutoscaleSetting to list autoscale enable or no on-configure.
Get-AzureRmAutoscaleSetting -ResourceGroup jasonnew
If the cloud service autoscale is enable, we will get the result, if not, nothing will output.
Also, we can use Azure portal to get the information: