Search code examples
azureazure-application-insightsazure-cli

Azure Application Insights, how to change daily cap by Azure CLI


I'm trying to change daily cap for data transfer for all my Application Insights on Azure. Is there any way to change it for all of them?

I can't find how to do it by using Azure CLI.

Thank you.


Solution

  • You can change the daily cap with the Azure PowerShell cmdlet Set-AzureRmApplicationInsightsDailyCap.

    Login-AzureRmAccount
    Set-AzureRmContext -SubscriptionName "Your Sub Name"
    
    function Set-DailyCap {
    
        $AI = Get-AzureRmApplicationInsights | Select ResourceGroupName, Name 
    
        $AI | foreach { 
        write-output ("Attempting to set daily cap for App Insights in resource group {0} instance {1}" -f $_.ResourceGroupName, $_.Name)
        Set-AzureRmApplicationInsightsDailyCap -ResourceGroupName $_.ResourceGroupName -Name $_.Name -DailyCapGB 0.2 
    
        }
    }
    
    Set-DailyCap