Unable to set 2 Properties using az functionapp plan update - azure

We need to set Property through az functionapp plan update
We are using Premium Plan.
The links
https://learn.microsoft.com/en-us/azure/app-service/manage-scale-per-app
https://learn.microsoft.com/en-US/cli/azure/functionapp/plan?view=azure-cli-latest#az_functionapp_plan_update
does not talk about these 2 property accurate names...
per-site-scaling?
per_site_scaling?
perSiteScaling?

per-site-scaling is a feature in app service not for the azure functions app.
Maximum function app instances
In addition to the plan maximum instance count, you can configure a per-app maximum. The app maximum can be configured using the app scale limit.
In-order to increase the Maximum scale out limit of app scale out under a function app use the below command
az resource update --resource-type Microsoft.Web/sites -g <RESOURCE_GROUP> -n <FUNCTION_APP-NAME>/config/web --set properties.functionAppScaleLimit=<SCALE_LIMIT>
Here is the more information about the maximum scale out limit for app scale out in function app

Related

Adding Metric Source to Autoscale in AzureCLI for WebApp

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.

How to monitor growth of On Premise Azure Devops Server

We have our on-premise Azure DevOps Server that is growing quite fast. The database files (SQL Server 14) were about 130 GB. In less than a month are now 160 GB.
There's an agent monitor (maybe an Azure DevOps extension?) to log mostly Azure DevOps operations that may cause this? Not only push etc. standard GIT operation but something more specific? We have several repositories, pipelines, artifacts, etc.
Edit: auditing on Azure DevOps Services isn't available for on-premises deployments. And more there are several 3rd part providers offering this service but again seems like they work only in the cloud.
What eventually I'm looking for is a way to know the memory occupancy of a single Team Project or its pipeline/release etc. Then it will be easy to check day after day who is growing so rapidly.
You can check the Azure DevOps server growth using continuous monitoring by application insights
You can set the alert rules using the below sample CLI script
To modify alert rule settings:
In the left pane of the release pipeline page, select Configure Application Insights Alerts.
$subscription = az account show --query "id";$subscription.Trim("`"");$resource="/subscriptions/$subscription/resourcegroups/"+"$(Parameters.AppInsightsResourceGroupName)"+"/providers/microsoft.insights/components/" + "$(Parameters.ApplicationInsightsResourceName)";
az monitor metrics alert create -n 'Availability_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'avg availabilityResults/availabilityPercentage < 99' --description "created from Azure DevOps";
az monitor metrics alert create -n 'FailedRequests_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'count requests/failed > 5' --description "created from Azure DevOps";
az monitor metrics alert create -n 'ServerResponseTime_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'avg requests/duration > 5' --description "created from Azure DevOps";
az monitor metrics alert create -n 'ServerExceptions_$(Release.DefinitionName)' -g $(Parameters.AppInsightsResourceGroupName) --scopes $resource --condition 'count exceptions/server > 5' --description "created from Azure DevOps";
You can modify the script and add additional rules, and you can even modify alert conditions. or you can even remove alert rules which you don't require

Is there an Azure CLI command for getting Health Check status from Function App?

I've created a Function App, and everything seems to be running fine. In the Azure Portal, Function App Overview I can see that the Health Check is "100.00% (Healthy 2 / Degraded 0)", and on the Health Check page of the Function App I can see that it's enabled and the endpoint is "api/health".
Is there a way to get the "100% (Healthy 2 / Degraded 0)" through an Azure CLI command. It looks like az functionapp list only gives me the siteConfig.healthCheckPath value and that's not what I need.
You can fetch the values of Health Check Status metric by using the Azure CLI command az monitor metrics list as described here https://learn.microsoft.com/en-us/cli/azure/monitor/metrics?view=azure-cli-latest#az-monitor-metrics-list.
Example:
az monitor metrics list --resource myresource --resource-group myresourcegroup --resource-type "Microsoft.Web/sites" --metric "HealthCheckStatus" --interval 5m
Note that the --interval property is important as health checks do not support the default 1m interval used by az monitor metrics list

How to Simulate Eviction of nodes in Azure Kubernetes

I have spot instance nodes in Azure Kubernetes Cluster. I want to simulate the eviction of a node so as to debug my code but not able to. All I could find in azure docs is we can simulate eviction for a single spot instance, using the following:
az vm simulate-eviction --resource-group test-eastus --name test-vm-26
However, I need to simulate the eviction of a spot node pool or a spot node in an AKS cluster.
For simulating evictions, there is no AKS REST API or Azure CLI command because evictions of the underlying infrastructure is not handled by AKS RP.
Only during creation of the AKS cluster the AKS RP can set eviction Policy on the underlying infrastructure by instructing the Azure Compute RP to do so.
Instead to simulate the eviction of node infrastructure, the customer can use az vmsss simulate-eviction command or the corresponding REST API.
az vmss simulate-eviction
az vmss simulate-eviction --instance-id
--name
--resource-group
[--subscription]
Reference Documents:
https://learn.microsoft.com/en-us/cli/azure/vmss?view=azure-cli-latest#az_vmss_simulate_eviction
https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-scale-set-vms/simulate-eviction
Use the following commands to get the name of the vmss with nodepool:
1.
az aks nodepool list -g $ClusterRG --cluster-name $ClusterName -o
table
Get the desired node pool name from the output
2.
CLUSTER_RESOURCE_GROUP=$(az aks show –resource-group YOUR_Resource_Group --name YOUR_AKS_Cluster --query
nodeResourceGroup -o tsv)
az vmss list -g $CLUSTER_RESOURCE_GROUP --query "[?tags.poolName == '<NODE_POOL_NAME>'].{VMSS_Name:name}" -o tsv
References:
https://louisshih.gitbooks.io/kubernetes/content/chapter1.html
https://ystatit.medium.com/azure-ssh-into-aks-nodes-471c07ad91ef
https://learn.microsoft.com/en-us/cli/azure/vmss?view=azure-cli-latest#az_vmss_list_instances
(you may create vmss if you dont have it configured. Refer :create a VMSS)

How to change the number of target instances in an Azure Virtual Machine Scale Set?

I've created an Azure VMSS and used a target instance count of 1 during my testing. Now that I'm ready to go live for my customer, I really need to change the target instance count to at least 2 for HA reasons. Is there a way to do this via Azure CLI or other means without having to rebuild everything?
Is there a way to do this via Azure CLI or other means without having
to rebuild everything?
Yes, we can use Azure Resource Explorer to configure and update the autoscale setting for a scale set. Azure Resource Explorer is an easy way to manage Azure resources via Resource Manager templates. Here are my steps:
1. login Azure Resource Explorer.
2. switch Read Only to Read/Write.
3. select subscription and resource group, find the vmss and autoscalesettings, then edit it.
4. After edit is complete, select PUT.
5. Then we can find the result from Azure protal.
More information about configure and update the autoscale setting for a scale set, refer to the link.
You can change the capacity of a VM Scale set in the following ways:
Use the Azure portal - Click on your VM scale set and then select the Scaling blade. Use the slider bar.
Use the CLI 2.0 az vmss scale command.
Using Azure PowerShell 5.0.0 or later use this command:
Update-AzureRmVmss -ResourceGroupName myrg -VMScaleSetName myvmss -SkuCapacity 3

Resources