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
Related
I use "az monitor scheduled-query" to create ALerting on Application Insight on Azure but it show me error message "ERROR: (BadRequest) Scope can not be updated"
. Please help me to fix this bug
I have run the command to create the alert rule in Application Insights for Azure VM with the below command:
az monitor scheduled-query create -g "HariTestRG" -n "testkvm01" --scopes "/subscriptions/<subs-id>/resourceGroups/<RGName>/providers/Microsoft.Compute/virtualMachines/testkvm01" --condition "count 'Placeholder_1' > 360 resource id _ResourceId at least 1 violations out of 5 aggregated points" --condition-query Placeholder_1="union Event, Syslog | where TimeGenerated > ago(1h) | where EventLevelName=='Error' or SeverityLevel=='err'" --description "Test rule"
Here vm_id is the resource id of the virtual machine.
Result:
In Portal View:
References: MSFT Doc of CLI command to create the Scheduled Alert
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
I want to monitor metrics of all virtual machines inside my subscription with Azure CLI. According to Microsoft's "az monitor metrics alert" documentation, each alert created for a specific resource id, for example:
az monitor metrics alert create -n alert1 -g {ResourceGroup} --scopes {VirtualMachineID} --condition "avg Percentage CPU > 90" --description "High CPU"
Can I create an alert for monitoring high CPU for all VMs (instead of creating many alerts associated with a specific VM)?
Moreover, how can I configure my email as an alert action?
Thank you.
From the syntax, it seems like if we just pass a comma-separated list of Resource IDs to --scope parameter we should be able to create a metrics alert for multiple resources. But it doesn't seem to work as expected.
As an alternative, you can configure an ARM Template to create Azure Monitor Metrics alert that can target/monitor multiple resources in one or more Resource Groups, or in a Subscription.
You can refer this documentation on how to build ARM Templates for a Metric alert that monitors multiple resources.
In this template, you'll need to provide the Action Group ID for the Action Group which specifies the actions to be taken when the alert triggers. To obtain the Action Group ID, use Set-AzActionGroupto create an Action Group wherein you can specify the action to receive email in the -Receiver parameter.
Once you've configured your template & template parameters JSON file, you can use the following Az CLI cmdlet block to deploy it in Azure:
Connect-AzAccount
Select-AzSubscription -SubscriptionName <yourSubscriptionName>
New-AzResourceGroupDeployment -Name myDeployment -ResourceGroupName <ResourceGroupWhereRuleShouldbeSaved> -TemplateFile template.json -TemplateParameterFile templateparams.parameters.json
Hope this helps!
I have some alerts set up based on activity log - when certain resources are create/updated. I would like to disabled them for the deployment time (Azure DevOps, including ARM template) - to not be spammed with unnecessary emails.
So before each deployment (and after deploying ARM template) I would run code like this:
az monitor activity-log alert list --resource-group ${RESOURCE_GROUP_NAME} --query "[].[name, enabled]" -o tsv | while read ALERT_NAME ALERT_STATUS
do
if [[ ${ALERT_STATUS} == "True" ]]
then
az monitor activity-log alert update --resource-group ${RESOURCE_GROUP_NAME} --name ${ALERT_NAME} --enabled false
fi
done
And switch them on as a last step of deployment.
However this doesn't seem to suppress the alerts. My guess is that it need some time to refresh status somewhere.
Any clue what it might be and how to fix/workaround it?
You can use action rules to suppress alerts during deployments. See these docs on that:
https://learn.microsoft.com/en-us/azure/azure-monitor/platform/alerts-action-rules
The Manage and request quotas for Azure resources documentation page states that the default quota depends "on your subscription offer type". The quota doesn't show up in Azure web portal. Is there a way to find out current quota values using SDK, CLI, REST API?
You probably want to try something like this command :
az vm list-usage --location eastus --out table
It would get you the core usage for the region, which is what is important for deployment of resources.
Other choices (az + Powershell) are available here.
Hope this helps!